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

Conversation

sashko9807
Copy link
Member

Complementary to #1446

Motivation and context

This PR contains the necessary backend changes to serve the campaign related news functionality

Testing

Steps to test

New endpoints

Environment

New environment variables:

  • NEW_ENV_VAR: env var details

New or updated dependencies:

Dependency name Previous version Updated version Details
dependency/name v1.0.0 v2.0.0

sashko9807 added 15 commits June 7, 2023 15:43
Duplication of CampaignFile module and accomodated to work for the news
-Seed 5 drafts
-Seed 5 published news
On the frontend side the campaign title is needed when visualizing the news for specific campaign.
This change prevents unexpected behavior such as the news page crashing in case no news were found for the specific campaign, or user has visited the news page via invalid campaign slug
-Change the key to `campaignNews` to correctly represent the name of the relation
-Take the latest two published articles for the campaign
…ched

-Needed to accomodate the latest frontend changes for SingleArticlePage
-Include article slug in listAdmin `:campaignSlug/list` endpoint
@github-actions
Copy link

github-actions bot commented Jun 14, 2023

✅ Tests will run for this PR. Once they succeed it can be merged.

Copy link
Contributor

@igoychev igoychev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great code overall!

I just have one general comment on naming:
It looks like you're using 'articles' and 'news' for the same entity - it will be great to choose one and rename the others. I'd vote for 'news' if you need my vote :)

schema.prisma Outdated Show resolved Hide resolved
schema.prisma Outdated Show resolved Hide resolved
schema.prisma Outdated Show resolved Hide resolved
schema.prisma Outdated Show resolved Hide resolved
apps/api/src/campaign/campaign.controller.ts Outdated Show resolved Hide resolved
apps/api/src/campaign/campaign.module.ts Outdated Show resolved Hide resolved
Comment on lines +6 to +7
const SEED_PUBLISHED_NEWS = 5
const SEED_DRAFT_NEWS = 5
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cool for adding the seeds!

@@ -0,0 +1,20 @@
-- AlterEnum
ALTER TYPE "campaign_file_role" ADD VALUE 'gallery';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice! definitely needed for other improvements too!

@sashko9807 sashko9807 force-pushed the campaign-news-functionality branch from 87b2904 to c7a7e64 Compare June 18, 2023 11:41
@igoychev igoychev added the run tests Allows running the tests workflows for forked repos label Jun 21, 2023
@github-actions github-actions bot removed the run tests Allows running the tests workflows for forked repos label Jun 21, 2023
@igoychev igoychev added the run tests Allows running the tests workflows for forked repos label Jun 27, 2023
@github-actions github-actions bot removed the run tests Allows running the tests workflows for forked repos label Jun 27, 2023
As we import the PersonModule, there is no need for injecting PersonService anymore
@igoychev igoychev added the run tests Allows running the tests workflows for forked repos label Jun 30, 2023
@github-actions github-actions bot removed the run tests Allows running the tests workflows for forked repos label Jun 30, 2023
@igoychev igoychev added the run tests Allows running the tests workflows for forked repos label Jul 3, 2023
@github-actions github-actions bot removed the run tests Allows running the tests workflows for forked repos label Jul 3, 2023
@igoychev igoychev merged commit 1afc7b4 into podkrepi-bg:master Jul 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants