refactor: Extract Invitation routes to InvitationController (no-changelog) (#7726)
This PR: - Creates `InvitationController` - Moves `POST /users` to `POST /invitations` and move related test to `invitations.api.tests` - Moves `POST /users/:id` to `POST /invitations/:id/accept` and move related test to `invitations.api.tests` - Adjusts FE to use new endpoints - Moves all the invitation logic to the `UserService` --------- Co-authored-by: कारतोफ्फेलस्क्रिप्ट™ <aditya@netroy.in>
This commit is contained in:
@@ -98,11 +98,11 @@ async function request(config: {
|
||||
}
|
||||
}
|
||||
|
||||
export async function makeRestApiRequest(
|
||||
export async function makeRestApiRequest<T>(
|
||||
context: IRestApiContext,
|
||||
method: Method,
|
||||
endpoint: string,
|
||||
data?: IDataObject,
|
||||
data?: any,
|
||||
) {
|
||||
const response = await request({
|
||||
method,
|
||||
@@ -113,7 +113,7 @@ export async function makeRestApiRequest(
|
||||
});
|
||||
|
||||
// @ts-ignore all cli rest api endpoints return data wrapped in `data` key
|
||||
return response.data;
|
||||
return response.data as T;
|
||||
}
|
||||
|
||||
export async function get(
|
||||
|
||||
Reference in New Issue
Block a user