-
Notifications
You must be signed in to change notification settings - Fork 1
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
refactor(app): New API service #4381
base: main
Are you sure you want to change the base?
Conversation
Code Climate has analyzed commit 40ae9ec and detected 0 issues on this pull request. The test coverage on the diff in this pull request is 100.0% (50% is the threshold). This pull request will bring the total coverage in the repository to 45.3% (0.0% change). View more on Code Climate. |
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.
pour les service je voyais plus quelque chose comme ça https://github.com/betagouv/service-national-universel/blob/fac8a67dc0dca438f110ba242f6e5a79f160e090/admin/src/services/classeService.ts
pour qu'il gère lui même le throw et que côté composant react on gère le catch exception si besoin
return res; | ||
} | ||
|
||
async getUser() { |
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.
du coup si c'est une api générique, il ne faudrait pas avoir de service user dedans non ?
credentials: RequestCredentials; | ||
} | ||
|
||
interface ApiResponse { |
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.
utiliser RouteResponseBody
depuis la snu-lib
export type RouteResponseBody<T> = { ok: boolean; data?: T; code?: string; message?: string }; |
const res = await response.json(); | ||
return res; | ||
} | ||
async remove(path: string): Promise<ApiResponse> { |
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.
pourquoi remove alors qu'on utilise le verbe http DELETE ?
return user as YoungDto; | ||
} | ||
|
||
async openpdf(path: string, body: unknown) { |
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.
downloadPdf plutot non ?
Pull Request Title Rules
Pull request format must respect this format:
Allowed types:
feat
,fix
,refactor
,chore
.Allowed scopes:
release
,app
,admin
,misc
,api
,all
,github
,terraform
,kb
,lib
.Notion ID, followed by a
-
is mandatory on typesrefactor
,feat
andfix
.If you really need to bypass the pull request title validation, you can add the
bypass title
label to you PR.Examples of valid PR titles:
chore(release): New version 1.3.3.7
refactor(api): 1789 - Removed monarchy from codebase
fix(api, app, admin): 1981 - User cannot delete each other accounts anymore.
fix(api): sentry - Implement capture or fix a bug.
Description
Todo
Checklist
Ticket / Issue
Testing instructions