This commit is contained in:
2025-11-12 16:03:57 +07:00
parent 87269a6615
commit 0ca7536b70
11 changed files with 1250 additions and 60 deletions

31
constants/Config.ts Normal file
View File

@@ -0,0 +1,31 @@
export const API_CONFIG = {
// Thay đổi URL này khi deploy
BASE_URL: __DEV__
? 'http://192.168.2.141:8080/api'
: 'http://192.168.2.141:8080/api',
TIMEOUT: 10000,
};
// Pagination
export const PAGINATION = {
DEFAULT_PAGE: 0,
DEFAULT_SIZE: 10,
MAX_SIZE: 50,
};
// Sort options
export const SORT_OPTIONS = {
PRODUCT_ID_ASC: { sortBy: 'productId', sortDir: 'asc' as const },
PRODUCT_ID_DESC: { sortBy: 'productId', sortDir: 'desc' as const },
PRICE_ASC: { sortBy: 'price', sortDir: 'asc' as const },
PRICE_DESC: { sortBy: 'price', sortDir: 'desc' as const },
NAME_ASC: { sortBy: 'productName', sortDir: 'asc' as const },
NAME_DESC: { sortBy: 'productName', sortDir: 'desc' as const },
};
export default {
API_CONFIG,
PAGINATION,
SORT_OPTIONS,
};