|
import { ASSETS_CATEGORIES, IMAGE_CATEGORIES } from 'features/gallery/store/types'; |
|
import queryString from 'query-string'; |
|
import { buildV1Url } from 'services/api'; |
|
|
|
import type { ImageDTO, ListImagesArgs } from './types'; |
|
|
|
export const getCategories = (imageDTO: ImageDTO) => { |
|
if (IMAGE_CATEGORIES.includes(imageDTO.image_category)) { |
|
return IMAGE_CATEGORIES; |
|
} |
|
return ASSETS_CATEGORIES; |
|
}; |
|
|
|
|
|
export const getListImagesUrl = (queryArgs: ListImagesArgs) => |
|
buildV1Url(`images/?${queryString.stringify(queryArgs, { arrayFormat: 'none' })}`); |
|
|