enhance(backend): 個人宛のお知らせはわかったを押すとアーカイブするように (#14762)
* enhance(backend): 個人宛のお知らせはわかったを押すとアーカイブするように
* Update Changelog
* enhance(frontend): アーカイブ済みのものを読み込めるように
* Update Changelog
* fix changelog
* 🎨
This commit is contained in:
@@ -209,6 +209,13 @@ export class AnnouncementService {
|
||||
return;
|
||||
}
|
||||
|
||||
const announcement = await this.announcementsRepository.findOneBy({ id: announcementId });
|
||||
if (announcement != null && announcement.userId === user.id) {
|
||||
await this.announcementsRepository.update(announcementId, {
|
||||
isActive: false,
|
||||
});
|
||||
}
|
||||
|
||||
if ((await this.getUnreadAnnouncements(user)).length === 0) {
|
||||
this.globalEventService.publishMainStream(user.id, 'readAllAnnouncements');
|
||||
}
|
||||
|
@@ -153,6 +153,12 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||
<div v-else-if="tab === 'announcements'" class="_gaps">
|
||||
<MkButton primary rounded @click="createAnnouncement"><i class="ti ti-plus"></i> {{ i18n.ts.new }}</MkButton>
|
||||
|
||||
<MkSelect v-model="announcementsStatus">
|
||||
<template #label>{{ i18n.ts.filter }}</template>
|
||||
<option value="active">{{ i18n.ts.active }}</option>
|
||||
<option value="archived">{{ i18n.ts.archived }}</option>
|
||||
</MkSelect>
|
||||
|
||||
<MkPagination :pagination="announcementsPagination">
|
||||
<template #default="{ items }">
|
||||
<div class="_gaps_s">
|
||||
@@ -254,11 +260,15 @@ const filesPagination = {
|
||||
userId: props.userId,
|
||||
})),
|
||||
};
|
||||
|
||||
const announcementsStatus = ref<'active' | 'archived'>('active');
|
||||
|
||||
const announcementsPagination = {
|
||||
endpoint: 'admin/announcements/list' as const,
|
||||
limit: 10,
|
||||
params: computed(() => ({
|
||||
userId: props.userId,
|
||||
status: announcementsStatus.value,
|
||||
})),
|
||||
};
|
||||
const expandedRoles = ref([]);
|
||||
|
Reference in New Issue
Block a user