Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[2/2] Backend service for campaign's related news #501

Merged
merged 29 commits into from
Jul 3, 2023
Merged
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
e5b8362
prisma: Add schema for campaign news
sashko9807 Jun 7, 2023
ec26952
api/src: Add campaign news module
sashko9807 Jun 7, 2023
0fd829c
src/campaign: Add new endpoints to show campaign related news
sashko9807 Jun 7, 2023
9493194
prisma: Add schema for news files
sashko9807 Jun 7, 2023
4805d0d
api/src: Add CampaignNewsFile module
sashko9807 Jun 7, 2023
89e6df0
campaign-news: Include article files in response
sashko9807 Jun 7, 2023
c6eb27b
src/campaign: Include the latest 2 news as part of the slug endpoint …
sashko9807 Jun 7, 2023
b335e3b
prisma: Seed campaign news
sashko9807 Jun 7, 2023
8c0ff5b
src/campaign-news-file: Encode UTF-8 filename
sashko9807 Jun 7, 2023
2035547
Get news for specific campaign via the campaignNews relation
sashko9807 Jun 10, 2023
67e7da8
campaign-news: Allow for campaign's organizer to create/edit/delete a…
sashko9807 Jun 10, 2023
55b5658
campaign-news: List all news for specific campaign
sashko9807 Jun 10, 2023
26e0a66
src/campaign: Add new endpoint to check whether logged user is campai…
sashko9807 Jun 10, 2023
b951cf8
src/campaign: Fix news timeline on campaign page
sashko9807 Jun 10, 2023
d8938a5
campaign-news: Include articleFile relation when slug endpoint is rea…
sashko9807 Jun 13, 2023
2a987d0
prisma: Rename articleFiles to newsFiles
sashko9807 Jun 18, 2023
9cb1d65
CampaignNewsFileModule: Remove unused imports
sashko9807 Jun 18, 2023
c7a7e64
campaign: slug/can-edit Remove keycloakId param
sashko9807 Jun 18, 2023
7990e11
CampaignModule: Import CampaignNewsModule
sashko9807 Jun 18, 2023
98dd7a2
CampaignNewsController: Remove Public() annotation from campaignSlug/…
sashko9807 Jun 18, 2023
65d34eb
CampaignNewsController: Remove unncessary @Roles() annotations
sashko9807 Jun 18, 2023
db23038
Merge branch 'master' into campaign-news-functionality
igoychev Jun 27, 2023
7a2113b
replaced PersonService with import of PersonModule to fix the tests
igoychev Jun 27, 2023
e6d1463
added import for CampaignNewsModule to fix the tests
igoychev Jun 27, 2023
3825bd7
added missing import of ConfigModule to fix the tests
igoychev Jun 27, 2023
23430d7
campaign-news: Use logged in user's first and last name if author fie…
sashko9807 Jun 27, 2023
1d44ed8
campaign-news: Remove unnecessary inject
sashko9807 Jun 27, 2023
0592843
prisma: Make CampaignNews' slug field unique
sashko9807 Jun 30, 2023
53d9be3
Merge branch 'master' into campaign-news-functionality
igoychev Jul 3, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
CampaignNewsController: Remove unncessary @roles() annotations
sashko9807 committed Jun 18, 2023
commit 65d34ebe74aaf20b959b88b1d17ca6c4b4f2946a
12 changes: 0 additions & 12 deletions apps/api/src/campaign-news/campaign-news.controller.ts
Original file line number Diff line number Diff line change
@@ -30,10 +30,6 @@ export class CampaignNewsController {
) {}

@Post()
@Roles({
roles: [],
mode: RoleMatchingMode.ANY,
})
async create(
@Body() createCampaignNewsDto: CreateCampaignNewsDto,
@AuthenticatedUser() user: KeycloakTokenParsed,
@@ -89,10 +85,6 @@ export class CampaignNewsController {
}

@Put(':id')
@Roles({
roles: [],
mode: RoleMatchingMode.ANY,
})
async editArticle(
@Param('id') articleId: string,
@Body() updateCampaignNewsDto: UpdateCampaignNewsDto,
@@ -128,10 +120,6 @@ export class CampaignNewsController {
}

@Delete(':id')
@Roles({
roles: [],
mode: RoleMatchingMode.ANY,
})
async delete(@Param('id') articleId: string, @AuthenticatedUser() user: KeycloakTokenParsed) {
const article = await this.campaignNewsService.findArticleByID(articleId)
if (!article) throw new NotFoundException('Article not found')