-
Notifications
You must be signed in to change notification settings - Fork 17
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
feat: Return item curation when updating/publishing #420
Changes from 20 commits
6f713af
7260dc8
b039075
7efbba9
b2b5d70
9fffc33
661ac2c
5d3ac36
7a631ed
6adf883
acaee9d
8317da2
6f115bc
ac4f5b0
d4d397e
4994e57
55ff34b
815462f
178015d
a481d10
d6cfbaa
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -341,13 +341,9 @@ export class CurationRouter extends Router { | |
) | ||
} | ||
|
||
return curationService.getModel().update( | ||
{ | ||
...curation, | ||
status: curationJSON.status, | ||
updated_at: this.getISODate(), | ||
}, | ||
{ id: curation.id } | ||
return await curationService.updateStatusAndReturnById( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as above, we need the updated row, so I created this method to update the |
||
curation.id, | ||
curationJSON.status | ||
) | ||
} | ||
|
||
|
@@ -389,8 +385,6 @@ export class CurationRouter extends Router { | |
return curationService.getModel().create(attributes) | ||
} | ||
|
||
private getISODate = () => new Date().toISOString() | ||
|
||
private validateAccessToCuration = async ( | ||
service: CurationService<any>, | ||
id: string, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,11 @@ export const patchCurationSchema = Object.freeze({ | |
properties: { | ||
status: { | ||
type: 'string', | ||
enum: [CurationStatus.APPROVED, CurationStatus.REJECTED], | ||
enum: [ | ||
CurationStatus.PENDING, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Adding |
||
CurationStatus.APPROVED, | ||
CurationStatus.REJECTED, | ||
], | ||
}, | ||
}, | ||
additionalProperties: false, | ||
|
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.
Adding this here because we need to keep track of the
itemCurations
in the FE as well, so now it's part of the response.