feat: チャンネルをお気に入りに登録できるように

Resolve #10097
This commit is contained in:
syuilo 2023-03-31 11:30:27 +09:00
parent 5d94062581
commit 3cb0cc7989
17 changed files with 327 additions and 10 deletions

View file

@ -1,6 +1,6 @@
import { Module } from '@nestjs/common';
import { DI } from '@/di-symbols.js';
import { User, Note, Announcement, AnnouncementRead, App, NoteFavorite, NoteThreadMuting, NoteReaction, NoteUnread, Notification, Poll, PollVote, UserProfile, UserKeypair, UserPending, AttestationChallenge, UserSecurityKey, UserPublickey, UserList, UserListJoining, UserNotePining, UserIp, UsedUsername, Following, FollowRequest, Instance, Emoji, DriveFile, DriveFolder, Meta, Muting, RenoteMuting, Blocking, SwSubscription, Hashtag, AbuseUserReport, RegistrationTicket, AuthSession, AccessToken, Signin, Page, PageLike, GalleryPost, GalleryLike, ModerationLog, Clip, ClipNote, Antenna, AntennaNote, PromoNote, PromoRead, Relay, MutedNote, Channel, ChannelFollowing, ChannelNotePining, RegistryItem, Webhook, Ad, PasswordResetRequest, RetentionAggregation, FlashLike, Flash, Role, RoleAssignment, ClipFavorite } from './index.js';
import { User, Note, Announcement, AnnouncementRead, App, NoteFavorite, NoteThreadMuting, NoteReaction, NoteUnread, Notification, Poll, PollVote, UserProfile, UserKeypair, UserPending, AttestationChallenge, UserSecurityKey, UserPublickey, UserList, UserListJoining, UserNotePining, UserIp, UsedUsername, Following, FollowRequest, Instance, Emoji, DriveFile, DriveFolder, Meta, Muting, RenoteMuting, Blocking, SwSubscription, Hashtag, AbuseUserReport, RegistrationTicket, AuthSession, AccessToken, Signin, Page, PageLike, GalleryPost, GalleryLike, ModerationLog, Clip, ClipNote, Antenna, AntennaNote, PromoNote, PromoRead, Relay, MutedNote, Channel, ChannelFollowing, ChannelFavorite, ChannelNotePining, RegistryItem, Webhook, Ad, PasswordResetRequest, RetentionAggregation, FlashLike, Flash, Role, RoleAssignment, ClipFavorite } from './index.js';
import type { DataSource } from 'typeorm';
import type { Provider } from '@nestjs/common';
@ -340,6 +340,12 @@ const $channelFollowingsRepository: Provider = {
inject: [DI.db],
};
const $channelFavoritesRepository: Provider = {
provide: DI.channelFavoritesRepository,
useFactory: (db: DataSource) => db.getRepository(ChannelFavorite),
inject: [DI.db],
};
const $channelNotePiningsRepository: Provider = {
provide: DI.channelNotePiningsRepository,
useFactory: (db: DataSource) => db.getRepository(ChannelNotePining),
@ -460,6 +466,7 @@ const $roleAssignmentsRepository: Provider = {
$mutedNotesRepository,
$channelsRepository,
$channelFollowingsRepository,
$channelFavoritesRepository,
$channelNotePiningsRepository,
$registryItemsRepository,
$webhooksRepository,
@ -528,6 +535,7 @@ const $roleAssignmentsRepository: Provider = {
$mutedNotesRepository,
$channelsRepository,
$channelFollowingsRepository,
$channelFavoritesRepository,
$channelNotePiningsRepository,
$registryItemsRepository,
$webhooksRepository,