Skip to content

Commit

Permalink
refactor delete to be function of class
Browse files Browse the repository at this point in the history
  • Loading branch information
Ell1ott committed Feb 28, 2024
1 parent 5d93865 commit 85253be
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 5 additions & 1 deletion src/lib/api/apiStore.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { get, writable } from 'svelte/store';
import { writable, type Writable } from 'svelte/store';
import type ApiHandler from '.';
import type { AuthorizerState } from 'akademia-authorizer-svelte/types';
import { getContext } from 'svelte';
Expand All @@ -16,6 +16,10 @@ export class FileInfo {
return api.callApi(this.apiPath + this.id, { name: newName }, 'PUT');
}

delete(api: ApiHandler) {
return api.callApi(this.apiPath + this.id, {}, 'DELETE');
}

constructor(info) {
this.id = info.id;
this.name = info.name;
Expand Down
4 changes: 0 additions & 4 deletions src/lib/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,6 @@ export default class ApiHandler {
);
};

deleteDocument = (documentId: string) => {
return this.callApi('/documents/' + documentId, {}, 'DELETE');
};

getAssignments = () => {
return this.callApi('/assignments');
};
Expand Down

0 comments on commit 85253be

Please sign in to comment.