chore: resolve conflict pull request

This commit is contained in:
rstubryan
2025-10-09 13:05:27 +07:00
40 changed files with 2460 additions and 434 deletions
+34 -1
View File
@@ -39,6 +39,21 @@ import {
Supplier,
UpdateSupplierPayload,
} from '@/types/api/master-data/supplier';
import {
CreateNonstockPayload,
Nonstock,
UpdateNonstockPayload,
} from '@/types/api/master-data/nonstock';
import {
Bank,
CreateBankPayload,
UpdateBankPayload,
} from '@/types/api/master-data/bank';
import {
CreateFcrPayload,
Fcr,
UpdateFcrPayload,
} from '@/types/api/master-data/fcr';
export const UomApi = new BaseApiService<
Uom,
@@ -86,4 +101,22 @@ export const SupplierApi = new BaseApiService<
Supplier,
CreateSupplierPayload,
UpdateSupplierPayload
>('/master-data/suppliers');
>('/master-data/suppliers');
export const NonstockApi = new BaseApiService<
Nonstock,
CreateNonstockPayload,
UpdateNonstockPayload
>('/master-data/nonstocks');
export const BankApi = new BaseApiService<
Bank,
CreateBankPayload,
UpdateBankPayload
>('/master-data/banks');
export const FcrApi = new BaseApiService<
Fcr,
CreateFcrPayload,
UpdateFcrPayload
>('/master-data/fcrs');
-87
View File
@@ -1,87 +0,0 @@
import axios from 'axios';
import { httpClient } from '@/services/http/client';
import {
CreateNonstockPayload,
DeleteNonstockResponse,
NonstockResponse,
UpdateNonstockPayload,
} from '@/types/api/master-data/nonstock';
export const getNonstock = async (nonstockId: number) => {
try {
const getNonstockRes = await httpClient<NonstockResponse>(
`/master-data/nonstocks/${nonstockId}`
);
return getNonstockRes;
} catch (error: unknown) {
if (axios.isAxiosError<NonstockResponse>(error)) {
return error.response?.data;
}
return undefined;
}
};
export const createNonstock = async (payload: CreateNonstockPayload) => {
try {
const createNonstockRes = await httpClient<NonstockResponse>(
'/master-data/nonstocks',
{
method: 'POST',
body: payload,
}
);
return createNonstockRes;
} catch (error: unknown) {
if (axios.isAxiosError<NonstockResponse>(error)) {
return error.response?.data;
}
return undefined;
}
};
export const updateNonstock = async (
nonstockId: number,
payload: UpdateNonstockPayload
) => {
try {
const updateNonstockRes = await httpClient<NonstockResponse>(
`/master-data/nonstocks/${nonstockId}`,
{
method: 'PATCH',
body: payload,
}
);
return updateNonstockRes;
} catch (error: unknown) {
if (axios.isAxiosError<NonstockResponse>(error)) {
return error.response?.data;
}
return undefined;
}
};
export const deleteNonstock = async (nonstockId: number) => {
try {
const deleteNonstockRes = await httpClient<DeleteNonstockResponse>(
`/master-data/nonstocks/${nonstockId}`,
{
method: 'DELETE',
}
);
return deleteNonstockRes;
} catch (error) {
if (axios.isAxiosError<DeleteNonstockResponse>(error)) {
return error.response?.data;
}
return undefined;
}
};