merge: resolve conflict

This commit is contained in:
rstubryan
2025-10-17 13:18:34 +07:00
11 changed files with 1023 additions and 888 deletions
+13 -3
View File
@@ -1,4 +1,9 @@
import { BaseApiService } from '@/services/api/base';
import {
CreateProductWarehousePayload,
ProductWarehouse,
UpdateProductWarehousePayload,
} from '@/types/api/inventory/product-warehouse';
import {
CreateMovementPayload,
Movement,
@@ -7,17 +12,22 @@ import {
import {
CreateInventoryAdjustmentPayload,
InventoryAdjustment,
UpdateInventoryAdjustmentPayload,
} from '@/types/api/inventory/adjustment';
export const ProductWarehouseApi = new BaseApiService<
ProductWarehouse,
CreateProductWarehousePayload,
UpdateProductWarehousePayload
>('/inventory/product-warehouses');
export const MovementApi = new BaseApiService<
Movement,
CreateMovementPayload,
UpdateMovementPayload
>('/inventory/movements');
>('/inventory/transfers');
export const inventoryAdjustmentApi = new BaseApiService<
InventoryAdjustment,
CreateInventoryAdjustmentPayload,
UpdateInventoryAdjustmentPayload
unknown
>('/inventory/adjustments');
+4 -1
View File
@@ -14,6 +14,9 @@ export async function httpClient<T, B = unknown>(
(!opts.auth && opts.auth !== 'none' && opts.auth !== 'bearer');
const isBearerAuth = opts.auth === 'bearer' && !!opts.token;
const isFormData =
typeof FormData !== 'undefined' && opts.body instanceof FormData;
const config: AxiosRequestConfig = {
url: path,
method: opts.method ?? 'GET',
@@ -22,7 +25,7 @@ export async function httpClient<T, B = unknown>(
timeout: opts.timeoutMs ?? 10_000,
withCredentials: isCookieAuth && !isBearerAuth,
headers: {
'Content-Type': 'application/json',
...(isFormData ? {} : { 'Content-Type': 'application/json' }),
...(opts.headers ?? {}),
...(isBearerAuth && !isCookieAuth
? { Authorization: `Bearer ${opts.token}` }