Add tag filter to blogs, portfolios, and videos list APIs.
Storefronts can filter published content by metadata.tags the same way as products; website API docs are updated to match. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
co-authored by
Cursor
parent
e0e122ed57
commit
1b16e79d3f
@@ -502,6 +502,14 @@ export class BlogsService {
|
||||
title: { contains: query.title.trim(), mode: 'insensitive' },
|
||||
}
|
||||
: {}),
|
||||
...(query.tag?.trim()
|
||||
? {
|
||||
metadata: {
|
||||
path: ['tags'],
|
||||
array_contains: query.tag.trim(),
|
||||
},
|
||||
}
|
||||
: {}),
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -39,6 +39,10 @@ export class ListBlogsDto {
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
title?: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
tag?: string;
|
||||
}
|
||||
|
||||
export class ListPublicBlogsDto {
|
||||
@@ -65,6 +69,10 @@ export class ListPublicBlogsDto {
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
title?: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
tag?: string;
|
||||
}
|
||||
|
||||
export class CreateBlogDto {
|
||||
|
||||
Reference in New Issue
Block a user