chore: update eslint and prettier configuration
This commit is contained in:
@@ -1,22 +1,30 @@
|
||||
import axiosClient from '../axios/axios';
|
||||
import { API_ROUTES } from '@/constants/apiRoutes';
|
||||
import type { Role, RoleListParams, RoleListResponse, RoleRequest } from '@/types';
|
||||
import type {
|
||||
Role,
|
||||
RoleListParams,
|
||||
RoleListResponse,
|
||||
RoleRequest,
|
||||
} from '@/types';
|
||||
|
||||
export const roleService = {
|
||||
getRoles: async (params?: RoleListParams): Promise<RoleListResponse> => {
|
||||
const response = await axiosClient.get<RoleListResponse>(API_ROUTES.ROLES.BASE, {
|
||||
params: {
|
||||
skip: params?.skip ?? 0,
|
||||
limit: params?.limit ?? 10,
|
||||
search_term: params?.search_term,
|
||||
name: params?.name,
|
||||
display_name: params?.display_name,
|
||||
description: params?.description,
|
||||
effective_status: params?.effective_status,
|
||||
sort_by: params?.sort_by,
|
||||
sort_order: params?.sort_order,
|
||||
const response = await axiosClient.get<RoleListResponse>(
|
||||
API_ROUTES.ROLES.BASE,
|
||||
{
|
||||
params: {
|
||||
skip: params?.skip ?? 0,
|
||||
limit: params?.limit ?? 10,
|
||||
search_term: params?.search_term,
|
||||
name: params?.name,
|
||||
display_name: params?.display_name,
|
||||
description: params?.description,
|
||||
effective_status: params?.effective_status,
|
||||
sort_by: params?.sort_by,
|
||||
sort_order: params?.sort_order,
|
||||
},
|
||||
},
|
||||
});
|
||||
);
|
||||
return response.data;
|
||||
},
|
||||
|
||||
@@ -33,9 +41,12 @@ export const roleService = {
|
||||
},
|
||||
|
||||
updateRoleStatus: async (id: number, isActive: boolean): Promise<Role> => {
|
||||
const response = await axiosClient.patch<Role>(API_ROUTES.ROLES.STATUS(id), {
|
||||
is_active: isActive,
|
||||
});
|
||||
const response = await axiosClient.patch<Role>(
|
||||
API_ROUTES.ROLES.STATUS(id),
|
||||
{
|
||||
is_active: isActive,
|
||||
},
|
||||
);
|
||||
return response.data;
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user