-
-
Notifications
You must be signed in to change notification settings - Fork 7.6k
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
chore(content-releases): releases migration to v5 #20259
base: v5/main
Are you sure you want to change the base?
Conversation
* chore: migrate bulkDelete to v5 * chore: change findLocales type to accept strings array * fix: docs prettier styles * chore: remove console.log
…into v5/bulk-publish-unpublish
This comment was marked as spam.
This comment was marked as spam.
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
const relatedReleases = await releaseService.findMany({ | ||
where: { | ||
releasedAt: null, | ||
releasedAt: { | ||
$null: true, | ||
}, | ||
actions: { | ||
target_type: contentTypeUid, | ||
target_id: entryId, | ||
}, | ||
}, | ||
}); | ||
|
||
const releases = await releaseService.findMany({ | ||
where: { | ||
$or: [ | ||
{ | ||
id: { | ||
$notIn: relatedReleases.map((release: any) => release.id), | ||
}, | ||
}, | ||
{ | ||
actions: null, | ||
}, | ||
], | ||
releasedAt: { | ||
$null: true, | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe these queries could be inside the service itself.
releases.findEntryReleases({id, populate...})
releases.findNotInEntryReleases({id, ...))
You could also reduce logic here if you do something like:
releases.findDocumentReleases({documentId, locale, populate...})
releases.findNotInDocumentReleases({documentId, locale, ...))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not 100% sure about this but we can discuss it when you're back
It's true that we reduce the controller complexity but we increase the service complexity and we need to maintain and look up for breaking changes in the service but not in the controller. What I mean is: Users can use the releases service in plugins or other places so in my opinion service's API should be as simple as possible and all these functions are just different way of using the findMany that already exists in the service
Don't know if it's something already fixed in the v5 branch , but it's a bit difficult for me to test strapi using multiple users atm. It's not possible for me to refresh the page when I have two tabs (one in incognito) with two different users. |
… type to handle relations
* feat: releases settings * feat: test nulling default timezone * chore: refactor tests * fix: remove async from describe * chore: OneOf type for response * chore: move OneOf utility to types package --------- Co-authored-by: Fernando Chavez <fernando.chavez@strapi.io>
* feat: releases settings * feat: test nulling default timezone * chore: refactor tests * fix: remove async from describe * feat: content releases settings permissions * chore: test for unauthorized role --------- Co-authored-by: Fernando Chavez <fernando.chavez@strapi.io>
What does it do?
Migrates and apply new changes on the Content Releases plugin for v5.
Work to do