mirror of
https://gitlab.dit.htwk-leipzig.de/htwk-software/htwkalender.git
synced 2026-01-17 12:02:26 +01:00
fix:#25 fixed router bug
This commit is contained in:
@@ -19,6 +19,23 @@ export async function createIndividualFeed(modules: Module[]): Promise<string> {
|
||||
return token;
|
||||
}
|
||||
|
||||
interface FeedResponse {
|
||||
modules: FeedModule[];
|
||||
collectionId: string;
|
||||
collectionName: string;
|
||||
id: string;
|
||||
retrieved: string;
|
||||
updated: string;
|
||||
}
|
||||
|
||||
interface FeedModule {
|
||||
course: string;
|
||||
name: string;
|
||||
reminder: boolean;
|
||||
userDefinedName: string;
|
||||
uuid: string;
|
||||
}
|
||||
|
||||
export async function saveIndividualFeed(
|
||||
token: string,
|
||||
modules: Module[],
|
||||
@@ -30,11 +47,14 @@ export async function saveIndividualFeed(
|
||||
},
|
||||
body: '{"modules":' + JSON.stringify(modules) + "}",
|
||||
})
|
||||
.then((response) => {
|
||||
return response.json();
|
||||
.then(async (response) => {
|
||||
// parse response.json to FeedResponse
|
||||
const feedResponse: FeedResponse = await response.json();
|
||||
return feedResponse;
|
||||
})
|
||||
.then((response) => {
|
||||
token = response;
|
||||
.then((response: FeedResponse) => {
|
||||
console.debug("response", response);
|
||||
token = response.id;
|
||||
});
|
||||
return token;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user