fix: 为hook/endpoint补全条目状态过滤机制
This commit is contained in:
@ -131,7 +131,16 @@ export default defineEndpoint({
|
|||||||
const queryFields = buildQueryFields(fields);
|
const queryFields = buildQueryFields(fields);
|
||||||
|
|
||||||
const itemService = new ItemsService(cfg.collection_name, { schema });
|
const itemService = new ItemsService(cfg.collection_name, { schema });
|
||||||
const items = await itemService.readByQuery({ fields: queryFields, limit: -1 });
|
const items = await itemService.readByQuery({
|
||||||
|
fields: queryFields,
|
||||||
|
filter: {
|
||||||
|
_or: [
|
||||||
|
{ status: { _neq: 'archived' } },
|
||||||
|
{ status: { _null: true } }
|
||||||
|
]
|
||||||
|
},
|
||||||
|
limit: -1,
|
||||||
|
});
|
||||||
|
|
||||||
// 为每种语言重建索引
|
// 为每种语言重建索引
|
||||||
for (const lang of availableLanguages) {
|
for (const lang of availableLanguages) {
|
||||||
|
|||||||
@ -157,15 +157,15 @@ export default defineHook(async ({ init, filter, action, schedule }, { services,
|
|||||||
const queryFields = buildQueryFields(fields);
|
const queryFields = buildQueryFields(fields);
|
||||||
|
|
||||||
const itemService = new ItemsService(cfg.collection_name, { schema });
|
const itemService = new ItemsService(cfg.collection_name, { schema });
|
||||||
const items = await itemService.readByQuery({
|
const items = await itemService.readByQuery({
|
||||||
fields: queryFields,
|
fields: queryFields,
|
||||||
filter: {
|
filter: {
|
||||||
_or: [
|
_or: [
|
||||||
{ status: { _null: true }},
|
{ status: { _neq: 'archived' } },
|
||||||
{ status: { _neq: 'archived'}},
|
{ status: { _null: true } },
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
limit: -1
|
limit: -1
|
||||||
});
|
});
|
||||||
|
|
||||||
// 为每种语言重建索引
|
// 为每种语言重建索引
|
||||||
@ -238,7 +238,16 @@ export default defineHook(async ({ init, filter, action, schedule }, { services,
|
|||||||
const queryFields = buildQueryFields(fields);
|
const queryFields = buildQueryFields(fields);
|
||||||
|
|
||||||
const itemService = new ItemsService(cfg.collection_name, { schema });
|
const itemService = new ItemsService(cfg.collection_name, { schema });
|
||||||
const items = await itemService.readByQuery({ fields: queryFields, limit: -1 });
|
const items = await itemService.readByQuery({
|
||||||
|
fields: queryFields,
|
||||||
|
filter: {
|
||||||
|
_or: [
|
||||||
|
{ status: { _neq: 'archived' } },
|
||||||
|
{ status: { _null: true } },
|
||||||
|
]
|
||||||
|
},
|
||||||
|
limit: -1
|
||||||
|
});
|
||||||
|
|
||||||
// 为每种语言重建索引
|
// 为每种语言重建索引
|
||||||
for (const lang of availableLanguages) {
|
for (const lang of availableLanguages) {
|
||||||
@ -310,7 +319,16 @@ export default defineHook(async ({ init, filter, action, schedule }, { services,
|
|||||||
const queryFields = buildQueryFields(fields);
|
const queryFields = buildQueryFields(fields);
|
||||||
|
|
||||||
const itemService = new ItemsService(cfg.collection_name, { schema });
|
const itemService = new ItemsService(cfg.collection_name, { schema });
|
||||||
const items = await itemService.readByQuery({ fields: queryFields, limit: -1 });
|
const items = await itemService.readByQuery({
|
||||||
|
fields: queryFields,
|
||||||
|
filter: {
|
||||||
|
_or: [
|
||||||
|
{ status: { _neq: 'archived' } },
|
||||||
|
{ status: { _null: true } },
|
||||||
|
]
|
||||||
|
},
|
||||||
|
limit: -1
|
||||||
|
});
|
||||||
|
|
||||||
// 为每种语言重建索引
|
// 为每种语言重建索引
|
||||||
for (const lang of availableLanguages) {
|
for (const lang of availableLanguages) {
|
||||||
@ -386,7 +404,16 @@ export default defineHook(async ({ init, filter, action, schedule }, { services,
|
|||||||
const queryFields = buildQueryFields(fields);
|
const queryFields = buildQueryFields(fields);
|
||||||
|
|
||||||
const itemService = new ItemsService(cfg.collection_name, { schema });
|
const itemService = new ItemsService(cfg.collection_name, { schema });
|
||||||
const items = await itemService.readByQuery({ fields: queryFields, limit: -1 });
|
const items = await itemService.readByQuery({
|
||||||
|
fields: queryFields,
|
||||||
|
filter: {
|
||||||
|
_or: [
|
||||||
|
{ status: { _neq: 'archived' } },
|
||||||
|
{ status: { _null: true } },
|
||||||
|
]
|
||||||
|
},
|
||||||
|
limit: -1
|
||||||
|
});
|
||||||
|
|
||||||
// 为每种语言重建索引
|
// 为每种语言重建索引
|
||||||
for (const lang of availableLanguages) {
|
for (const lang of availableLanguages) {
|
||||||
|
|||||||
Reference in New Issue
Block a user