rename: authorizations 엔티티 이름에서 복수형 제거
This commit is contained in:
@@ -0,0 +1,53 @@
|
||||
import { client } from "@/shared/api";
|
||||
import { ENDPOINT } from "@/shared/config";
|
||||
import type {
|
||||
AuthorizationsService,
|
||||
AuthorizationsParams,
|
||||
AuthorizationsList,
|
||||
AuthorizationFormData,
|
||||
WithRoleAuthorizations,
|
||||
} from "../model/authorization-interface";
|
||||
|
||||
export class AuthorizationsApiService implements AuthorizationsService {
|
||||
public async getAuthorizationsList(
|
||||
params: AuthorizationsParams,
|
||||
): Promise<AuthorizationsList> {
|
||||
const response = await client.get<AuthorizationsList>(
|
||||
`${ENDPOINT.USER_SERVICE.AUTHORIZATIONS}`,
|
||||
{ params },
|
||||
);
|
||||
return response.data;
|
||||
}
|
||||
|
||||
public async getAuthorizationInfo(
|
||||
authorizationNo: string,
|
||||
): Promise<WithRoleAuthorizations> {
|
||||
const response = await client.get<WithRoleAuthorizations>(
|
||||
`${ENDPOINT.USER_SERVICE.AUTHORIZATIONS}/${authorizationNo}`,
|
||||
);
|
||||
return response.data;
|
||||
}
|
||||
|
||||
public async createAuthorization(
|
||||
data: AuthorizationFormData,
|
||||
): Promise<WithRoleAuthorizations> {
|
||||
const response = await client.post<WithRoleAuthorizations>(
|
||||
`${ENDPOINT.USER_SERVICE.AUTHORIZATIONS}`,
|
||||
data,
|
||||
);
|
||||
return response.data;
|
||||
}
|
||||
|
||||
public async updateAuthorization(
|
||||
authorizationNo: string,
|
||||
data: AuthorizationFormData,
|
||||
): Promise<WithRoleAuthorizations> {
|
||||
const response = await client.put<WithRoleAuthorizations>(
|
||||
`${ENDPOINT.USER_SERVICE.AUTHORIZATIONS}/${authorizationNo}`,
|
||||
data,
|
||||
);
|
||||
return response.data;
|
||||
}
|
||||
}
|
||||
|
||||
export const AuthorizationsApi = new AuthorizationsApiService();
|
||||
Reference in New Issue
Block a user