diff --git a/packages/backend/src/server/api/endpoints/admin/ad/list.ts b/packages/backend/src/server/api/endpoints/admin/ad/list.ts index 1366fbf76a..8cdeaae179 100644 --- a/packages/backend/src/server/api/endpoints/admin/ad/list.ts +++ b/packages/backend/src/server/api/endpoints/admin/ad/list.ts @@ -22,7 +22,7 @@ export const paramDef = { limit: { type: 'integer', minimum: 1, maximum: 100, default: 10 }, sinceId: { type: 'string', format: 'misskey:id' }, untilId: { type: 'string', format: 'misskey:id' }, - publishing: { type: 'boolean', default: null, nullable: true}, + publishing: { type: 'boolean', default: null, nullable: true }, }, required: [], } as const; diff --git a/packages/frontend/src/pages/admin/ads.vue b/packages/frontend/src/pages/admin/ads.vue index 1ce99d4ba5..1c15e32552 100644 --- a/packages/frontend/src/pages/admin/ads.vue +++ b/packages/frontend/src/pages/admin/ads.vue @@ -9,11 +9,11 @@ SPDX-License-Identifier: AGPL-3.0-only - + - - - + + +
@@ -104,8 +104,8 @@ let ads: any[] = $ref([]); const localTime = new Date(); const localTimeDiff = localTime.getTimezoneOffset() * 60 * 1000; const daysOfWeek: string[] = [i18n.ts._weekday.sunday, i18n.ts._weekday.monday, i18n.ts._weekday.tuesday, i18n.ts._weekday.wednesday, i18n.ts._weekday.thursday, i18n.ts._weekday.friday, i18n.ts._weekday.saturday]; +const filterType = ref('all'); let publishing: boolean | null = null; -let type = ref('null'); os.api('admin/ad/list', { publishing: publishing }).then(adsResponse => { if (adsResponse != null) { @@ -123,9 +123,15 @@ os.api('admin/ad/list', { publishing: publishing }).then(adsResponse => { } }); -const onChangePublishing = (v) => { - console.log(v); - publishing = v === 'true' ? true : v === 'false' ? false : null; +const filterItems = (v) => { + if (v === 'publishing') { + publishing = true; + } else if (v === 'expired') { + publishing = false; + } else { + publishing = null; + } + refresh(); };