fix(FE-33): fix conflict git

This commit is contained in:
randy-ar
2025-10-09 13:35:30 +07:00
59 changed files with 4048 additions and 327 deletions
+55 -1
View File
@@ -29,11 +29,36 @@ import {
Customer,
UpdateCustomerPayload,
} from '@/types/api/master-data/customer';
import {
CreateProductCategoryPayload,
ProductCategory,
UpdateProductCategoryPayload,
} from '@/types/api/master-data/product-category';
import {
CreateProductPayload,
Product,
UpdateProductPayload,
} from '@/types/api/master-data/product';
import {
CreateSupplierPayload,
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,
@@ -70,9 +95,38 @@ export const CustomerApi = new BaseApiService<
CreateCustomerPayload,
UpdateCustomerPayload
>('/master-data/customers');
export const ProductCategoryApi = new BaseApiService<
ProductCategory,
CreateProductCategoryPayload,
UpdateProductCategoryPayload
>('/master-data/product-categories');
export const ProductApi = new BaseApiService<
Product,
CreateProductPayload,
UpdateProductPayload
>('/master-data/products');
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;
}
};