rename: authorizations service 엔티티 이동
This commit is contained in:
@@ -1,53 +0,0 @@
|
||||
import { client } from "@/shared/api";
|
||||
import { ENDPOINT } from "@/shared/config";
|
||||
import type {
|
||||
AuthorizationsService,
|
||||
AuthorizationsParams,
|
||||
AuthorizationsList,
|
||||
AuthorizationFormData,
|
||||
WithRoleAuthorizations,
|
||||
} from "@/entities/authorizations";
|
||||
|
||||
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();
|
||||
@@ -6,10 +6,10 @@ import { zodResolver } from "@hookform/resolvers/zod";
|
||||
import { useMutation } from "@tanstack/react-query";
|
||||
import { useAlertStore } from "@/shared/lib/use-alert-store";
|
||||
import {
|
||||
AuthorizationsApi,
|
||||
authorizationFormSchema,
|
||||
type AuthorizationFormData,
|
||||
} from "@/entities/authorizations";
|
||||
import { AuthorizationsApi } from "../api/authorization-service";
|
||||
import { ModuleForm } from "./module-form";
|
||||
|
||||
function CreatePage() {
|
||||
|
||||
@@ -6,10 +6,10 @@ import { useMutation, useQuery } from "@tanstack/react-query";
|
||||
import { useAlertStore } from "@/shared/lib/use-alert-store";
|
||||
import { ENDPOINT } from "@/shared/config";
|
||||
import {
|
||||
AuthorizationsApi,
|
||||
authorizationFormSchema,
|
||||
type AuthorizationFormData,
|
||||
} from "@/entities/authorizations";
|
||||
import { AuthorizationsApi } from "../api/authorization-service";
|
||||
import { ModuleForm } from "./module-form";
|
||||
|
||||
function ModifyPage({ sequential }: { sequential: string }) {
|
||||
|
||||
@@ -11,12 +11,12 @@ import {
|
||||
import { Button, DataTable, Input, Label } from "@common/components";
|
||||
import { CodeSelect } from "@/entities/code";
|
||||
import { ENDPOINT } from "@/shared/config";
|
||||
import type {
|
||||
Authorizations,
|
||||
AuthorizationsParams,
|
||||
import {
|
||||
AuthorizationsApi,
|
||||
type Authorizations,
|
||||
type AuthorizationsParams,
|
||||
} from "@/entities/authorizations";
|
||||
import { columns } from "../model/authorizations-table-columns";
|
||||
import { AuthorizationsApi } from "../api/authorization-service";
|
||||
|
||||
function ModulePage() {
|
||||
const router = useRouter();
|
||||
|
||||
Reference in New Issue
Block a user