Skip to content

Commit

Permalink
Merge branch 'main' into feature/better-touch-support
Browse files Browse the repository at this point in the history
  • Loading branch information
GAsplund authored Dec 8, 2024
2 parents cb93590 + 16c2546 commit e04ea32
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/services/newsService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ export default class NewsService {
const publish =
edited.scheduledPublish === null && post?.status === PostStatus.SCHEDULED;

return await prisma.newsPost.update({
const updatedPost = await prisma.newsPost.update({
where: {
id: edited.id
},
Expand All @@ -181,11 +181,16 @@ export default class NewsService {
contentEn: edited.contentEn,
contentSv: edited.contentSv,
status: publish ? PostStatus.PUBLISHED : undefined,
createdAt: publish ? new Date() : undefined,
scheduledPublish: updateScheduledPublish
? edited.scheduledPublish
: undefined
}
});

if (publish) NotifyService.notifyNewsPost(updatedPost);

return updatedPost;
}

static async remove(id: number) {
Expand Down

0 comments on commit e04ea32

Please sign in to comment.