Skip to content

Commit

Permalink
Fix reset progress bug in remote (#788)
Browse files Browse the repository at this point in the history
  • Loading branch information
chriswilty authored Jan 19, 2024
1 parent 9a2b8e2 commit cc2fdb9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
7 changes: 4 additions & 3 deletions frontend/src/service/documentService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@ import { DocumentMeta } from '@src/models/document';

import { getBackendUrl, sendRequest } from './backendService';

const PATH = 'documents';

async function getDocumentMetas(signal?: AbortSignal): Promise<DocumentMeta[]> {
const path = 'documents';
const response = await sendRequest(path, { method: 'GET', signal });
const response = await sendRequest(PATH, { method: 'GET', signal });
let documentMetas = (await response.json()) as DocumentMeta[];
documentMetas = documentMetas.map((documentMeta) => {
return {
...documentMeta,
uri: `${getBackendUrl()}${path}/${documentMeta.folder}/${
uri: `${getBackendUrl()}${PATH}/${documentMeta.folder}/${
documentMeta.filename
}`,
};
Expand Down
4 changes: 3 additions & 1 deletion frontend/src/service/levelService.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { sendRequest } from './backendService';

const PATH = 'reset';

async function resetAllLevelProgress(): Promise<boolean> {
const response = await sendRequest(`/reset`, {
const response = await sendRequest(PATH, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
Expand Down

0 comments on commit cc2fdb9

Please sign in to comment.