Skip to content

Commit

Permalink
added update info
Browse files Browse the repository at this point in the history
  • Loading branch information
Ell1ott committed Feb 29, 2024
1 parent 7f836b0 commit b379725
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
8 changes: 7 additions & 1 deletion src/lib/api/apiStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export class FileInfo {
}

rename(newName: string, api: ApiHandler) {
return api.callApi(this.path, { name: newName }, 'PUT');
return this.updateInfo({ name: newName }, api);
}

delete(api: ApiHandler) {
Expand All @@ -42,9 +42,15 @@ export class FileInfo {
);
}

// Gets the members of the file from the api
getMembers(api: ApiHandler) {
return api.callApi(this.path + '/users');
}

// Requests the api to update information
updateInfo(info, api: ApiHandler) {
return api.callApi(this.path, info, 'PUT');
}
}

export class DocumentInfo extends FileInfo {
Expand Down
3 changes: 2 additions & 1 deletion src/routes/workspace/editor/Toolbar/ShareDocument.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@
});
});
console.log(people);
people = people;
});
});
}
Expand Down Expand Up @@ -145,7 +146,7 @@
<div class="flex space-x-4">
<Input placeholder="Email address" id="invite-email" />
<Select.Root>
<Select.Trigger class="w-[200px]">
<Select.Trigger class="w-[200px] text-nowrap">
<Select.Value placeholder="Vælg" />
</Select.Trigger>
<Select.Content>
Expand Down

0 comments on commit b379725

Please sign in to comment.