-
Notifications
You must be signed in to change notification settings - Fork 5
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
MARXAN-1380-unpublish-public-project #913
MARXAN-1380-unpublish-public-project #913
Conversation
This pull request is being automatically deployed with Vercel (learn more). marxan – ./app🔍 Inspect: https://vercel.com/vizzuality1/marxan/4Y8LRTLXbmqvfWQVPm3VFwkqvqMd marxan-storybook – ./app🔍 Inspect: https://vercel.com/vizzuality1/marxan-storybook/HvuL5FDQyZxJAuRUjDDWRfx2zXQX |
0cdf0df
to
8c4c1b8
Compare
8c4c1b8
to
fca0923
Compare
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.
thanks! IIRC you asked for naming suggestions on a different PR but I ended up suggesting a couple of naming changes here too... feel free to decide.
all the rest looks good!
authenticated users who are not admin, projects under moderation | ||
will be hiding from the listing. | ||
*/ | ||
if (!id || !(await this.usersService.isPlatformAdmin(id))) { |
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.
while we are revisiting this, let's make the name more explicit
if (!id || !(await this.usersService.isPlatformAdmin(id))) { | |
if (!userId || !(await this.usersService.isPlatformAdmin(userId))) { |
async changeModerationStatus( | ||
id: string, | ||
requestingUserId: string, | ||
status: boolean, | ||
withUnpublish?: boolean, |
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.
what about
withUnpublish?: boolean, | |
alsoUnpublish?: boolean, |
@@ -91,6 +96,43 @@ export class PublishProjectController { | |||
return; | |||
} | |||
|
|||
@Delete(':id/unpublish') |
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.
mh, this is quite down to preference, but I suggest to treat this as a kind-of-RPC-thingy-even-if-behind-the-scenes-we-are-deleting-a-resource and use POST instead
@Delete(':id/unpublish') | |
@Post(':id/unpublish') |
4990ab8
to
1e76b53
Compare
-Adds endpoint for
project_owners
to unpublish a public project.-Adds conditions to when clearing a project from under moderation to be able to outright unpublish the project straightaway.
-Adds tests for the new endpoint and changes in the workflow.
Depends on #896 being closed beforehand.