diff --git a/js/src/components/NavBar.vue b/js/src/components/NavBar.vue
index 972a55df..efbc62f8 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 61543f91..7dc92ca2 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 d7dcd056..c93c4c63 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 8440f91a..6d772716 100644
--- a/js/src/views/Group/Create.vue
+++ b/js/src/views/Group/Create.vue
@@ -1,87 +1,124 @@
-
-
- Create a new group
-
-