diff --git a/js/src/components/NavBar.vue b/js/src/components/NavBar.vue
index 972a55dfa..efbc62f84 100644
--- a/js/src/components/NavBar.vue
+++ b/js/src/components/NavBar.vue
@@ -40,6 +40,10 @@
My account
+
+ Create group
+
+
Log out
@@ -70,6 +74,7 @@ import { IConfig } from '@/types/config.model';
import { ICurrentUser } from '@/types/current-user.model';
import Logo from '@/components/Logo.vue';
import SearchField from '@/components/SearchField.vue';
+import { ActorRouteName } from '@/router/actor';
@Component({
apollo: {
@@ -95,6 +100,8 @@ export default class NavBar extends Vue {
currentUser!: ICurrentUser;
showNavbar: boolean = false;
+ ActorRouteName = ActorRouteName;
+
@Watch('currentUser')
async onCurrentUserChanged() {
// Refresh logged person object
diff --git a/js/src/graphql/actor.ts b/js/src/graphql/actor.ts
index 61543f916..7dc92ca20 100644
--- a/js/src/graphql/actor.ts
+++ b/js/src/graphql/actor.ts
@@ -174,3 +174,34 @@ query($name:String!) {
}
}
`;
+
+export const CREATE_GROUP = gql`
+ mutation CreateGroup(
+ $creatorActorId: Int!,
+ $preferredUsername: String!,
+ $name: String!,
+ $summary: String,
+ $avatar: PictureInput,
+ $banner: PictureInput
+ ) {
+ createGroup(
+ creatorActorId: $creatorActorId,
+ preferredUsername: $preferredUsername,
+ name: $name,
+ summary: $summary,
+ banner: $banner,
+ avatar: $avatar
+ ) {
+ id,
+ preferredUsername,
+ name,
+ summary,
+ avatar {
+ url
+ },
+ banner {
+ url
+ }
+ }
+ }
+`;
diff --git a/js/src/types/actor/group.model.ts b/js/src/types/actor/group.model.ts
index d7dcd0566..c93c4c638 100644
--- a/js/src/types/actor/group.model.ts
+++ b/js/src/types/actor/group.model.ts
@@ -19,4 +19,14 @@ export interface IMember {
export class Group extends Actor implements IGroup {
members: IMember[] = [];
+
+ constructor(hash: IGroup | {} = {}) {
+ super(hash);
+
+ this.patch(hash);
+ }
+
+ patch (hash: any) {
+ Object.assign(this, hash);
+ }
}
diff --git a/js/src/views/Group/Create.vue b/js/src/views/Group/Create.vue
index 8440f91ae..6d7727168 100644
--- a/js/src/views/Group/Create.vue
+++ b/js/src/views/Group/Create.vue
@@ -1,87 +1,124 @@
-
-
- Create a new group
-
-