Skip to content

Commit

Permalink
fix: 🐛 rework notification data
Browse files Browse the repository at this point in the history
edit notifications link and text after rework #2

review addNotifications and start fixing channel

comments and Reaction fixes

fix metadata

fix video mappings

fix utils

fix: nft mappings

fix: admin resolvers

fix: video resolvers

fix channel resolvers
  • Loading branch information
Ignazio Bovo committed Aug 24, 2023
1 parent 8979882 commit 4236549
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/server-extension/resolvers/ChannelsResolver/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ import {
newChannelFollowerLink,
newChannelFollowerText,
} from '../../../utils/notification'
import { assertNotNull } from '@subsquid/substrate-processor'

@Resolver()
export class ChannelsResolver {
Expand Down Expand Up @@ -238,17 +239,16 @@ export class ChannelsResolver {
// account not null because of the UseMiddleware(AccountOnly) decorator
throw new Error('Account not specified')
}
const followerAccount = ctx.account
const followerHandle =
(await em.getRepository(Membership).findOneByOrFail({ id: followerAccount.membershipId }))
?.handle || ''
const linkPage = await newChannelFollowerLink(em, followerHandle)
const channelTitle = channel.title || ''
const followerMembership = await em
.getRepository(Membership)
.findOneByOrFail({ id: ctx.account.membershipId })
const channelTitle = parseChannelTitle(channel)
await addNotification(
em,
ownerAccount,
new NewChannelFollower({
recipient: new ChannelRecipient({ channelTitle }),
followerHandle: assertNotNull(followerMembership.handle),
})
)
}
Expand Down

0 comments on commit 4236549

Please sign in to comment.