feat: implement filter feature

This commit is contained in:
2025-07-26 10:43:08 +07:00
parent 30b771d8ed
commit a43aa5a4e8
15 changed files with 319 additions and 20 deletions
+29
View File
@@ -71,6 +71,7 @@ export interface Config {
media: Media;
categories: Category;
products: Product;
tags: Tag;
'payload-locked-documents': PayloadLockedDocument;
'payload-preferences': PayloadPreference;
'payload-migrations': PayloadMigration;
@@ -85,6 +86,7 @@ export interface Config {
media: MediaSelect<false> | MediaSelect<true>;
categories: CategoriesSelect<false> | CategoriesSelect<true>;
products: ProductsSelect<false> | ProductsSelect<true>;
tags: TagsSelect<false> | TagsSelect<true>;
'payload-locked-documents': PayloadLockedDocumentsSelect<false> | PayloadLockedDocumentsSelect<true>;
'payload-preferences': PayloadPreferencesSelect<false> | PayloadPreferencesSelect<true>;
'payload-migrations': PayloadMigrationsSelect<false> | PayloadMigrationsSelect<true>;
@@ -189,11 +191,23 @@ export interface Product {
*/
price: number;
category?: (string | null) | Category;
tags?: (string | Tag)[] | null;
images?: (string | null) | Media;
refundPolicy?: ('30-day' | '14-day' | '7-day' | '3-day' | '1-day' | 'no-refunds') | null;
updatedAt: string;
createdAt: string;
}
/**
* This interface was referenced by `Config`'s JSON-Schema
* via the `definition` "tags".
*/
export interface Tag {
id: string;
name: string;
product?: (string | Product)[] | null;
updatedAt: string;
createdAt: string;
}
/**
* This interface was referenced by `Config`'s JSON-Schema
* via the `definition` "payload-locked-documents".
@@ -216,6 +230,10 @@ export interface PayloadLockedDocument {
| ({
relationTo: 'products';
value: string | Product;
} | null)
| ({
relationTo: 'tags';
value: string | Tag;
} | null);
globalSlug?: string | null;
user: {
@@ -315,11 +333,22 @@ export interface ProductsSelect<T extends boolean = true> {
description?: T;
price?: T;
category?: T;
tags?: T;
images?: T;
refundPolicy?: T;
updatedAt?: T;
createdAt?: T;
}
/**
* This interface was referenced by `Config`'s JSON-Schema
* via the `definition` "tags_select".
*/
export interface TagsSelect<T extends boolean = true> {
name?: T;
product?: T;
updatedAt?: T;
createdAt?: T;
}
/**
* This interface was referenced by `Config`'s JSON-Schema
* via the `definition` "payload-locked-documents_select".