File size: 514 Bytes
41a71fd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import { $api } from '@/shared/api/axiosInstance';
import { {{sliceName}}Type } from '@/entities/{{sliceName}}';

type Create{{sliceName}}Props = {
    user_id: number;
};

type Create{{sliceName}}Response = {
    status: number;
    message: string;
    {{lowerCase sliceName}}: {{sliceName}}Type;
};

export const create{{sliceName}} = async (props: Create{{sliceName}}Props) => {
    const { data } = await $api.post<Create{{sliceName}}Response>(`/{{lowerCase sliceName}}s/create`, props);

    return data;
};