chore: remove unused constants and service utility
- Deleted `discovery.ts` for unused constants related to discovery page limits and sorting. - Removed `unwrapService.ts`, a utility function for handling service results, as it is no longer needed.
This commit is contained in:
parent
9f0a3bfc86
commit
25c34c8a6f
@ -1,10 +0,0 @@
|
||||
export const DISCOVERY_PAGE_SIZE = 12
|
||||
|
||||
/** Home hero strip: most-booked events. */
|
||||
export const HOME_POPULAR_LIMIT = 3
|
||||
|
||||
/** Home category preview list under EventTitleRoller. */
|
||||
export const HOME_CATEGORY_PREVIEW_LIMIT = 6
|
||||
|
||||
export const HOME_POPULAR_SORT = '-bookedCount'
|
||||
export const HOME_CATEGORY_SORT = '-createdAt'
|
||||
@ -1,11 +0,0 @@
|
||||
import type { ServiceResult } from '@/services/errorHandler'
|
||||
|
||||
/**
|
||||
* Turns a ServiceResult into a thrown error for TanStack Query,
|
||||
* or returns the success payload.
|
||||
*/
|
||||
export const unwrapService = <T>(result: ServiceResult<T>): T => {
|
||||
if (result.ok) return result.data
|
||||
|
||||
throw result.error
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user