-
Notifications
You must be signed in to change notification settings - Fork 2
chore(schoolbook): ENABLING-421 schoolbook module fetch update #230
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
vmourot
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Attention à ne pas modifier les signatures des fonctions si possible.
Le premier argument est en général la session, même si rarement utilisé en pratique.
1149114 to
366da4b
Compare
| const api = `/schoolbook/list`; | ||
| const body = JSON.stringify({ filter: 'Any', page }); | ||
| const entcoreTeacherWordList = (await signedFetchJson(`${session?.platform!.url}${api}`, { | ||
| const entcoreTeacherWordList = await sessionFetch.json<IEntcoreTeacherWordList>(`${session?.platform!.url}${api}`, { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Retirer session?.platform!.url car sessionFetch le gère automatiquement
| const api = `/schoolbook/relation/acknowledge/${wordId}/${studentId}`; | ||
| return signedFetchJson(`${session?.platform!.url}${api}`, { | ||
|
|
||
| return sessionFetch.json<Promise<{ id: number }>>(`${session?.platform!.url}${api}`, { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Retirer session?.platform!.url car sessionFetch le gère automatiquement
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Pas besoin de typer avec Promise car la fonction est asynchrone
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok fait
| const api = `/schoolbook/delete/${wordId}`; | ||
| return signedFetchJson(`${session?.platform!.url}${api}`, { | ||
|
|
||
| return sessionFetch.json<Promise<{ rows: number }>>(`${session?.platform!.url}${api}`, { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Retirer session?.platform!.url car sessionFetch le gère automatiquement
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Pas besoin de typer avec Promise car la fonction est asynchrone
| const body = JSON.stringify({ studentId, text }); | ||
| return signedFetchJson(`${session?.platform!.url}${api}`, { | ||
|
|
||
| return sessionFetch.json<Promise<{ response_id: number }>>(`${session?.platform!.url}${api}`, { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Idem que pour les messages précédents
| const api = `/schoolbook/word/resend/${wordId}`; | ||
| return signedFetchJson(`${session?.platform!.url}${api}`, { | ||
|
|
||
| return sessionFetch.json<Promise<{ count: number; word_id: string }>>(`${session?.platform!.url}${api}`, { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Idem que pour les messages précédents
| const body = JSON.stringify({ text }); | ||
| return signedFetchJson(`${session?.platform!.url}${api}`, { | ||
|
|
||
| return sessionFetch.json<Promise<{ rows: number }>>(`${session?.platform!.url}${api}`, { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Idem que pour les messages précédents
701376b to
1fc1aba
Compare
1fc1aba to
0801dca
Compare
0801dca to
379e27c
Compare
|



No description provided.