-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add trial claim-collection mechanism and fix colors
- Loading branch information
Showing
5 changed files
with
58 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
const { StatusCodes } = require('http-status-codes'); | ||
const { checkAuth } = require('../../../middlewares/auth'); | ||
|
||
const { changeOwnership } = require('./_helpers'); | ||
|
||
module.exports = { | ||
post: [checkAuth, post], | ||
}; | ||
|
||
/** | ||
* @api {post} /v0/collections/ownership Get data into work and change ownership (experimental) | ||
* @apiName ListCollectionData | ||
* @apiGroup Collections | ||
* @apiPermission GUI_ONLY | ||
* @apiSuccess (202) reqId response sent to a separate server-side event stream. | ||
* @apiUse SSEStreamResponse | ||
*/ | ||
async function post(req, res, next) { | ||
const reqId = req.id; | ||
|
||
res.status(StatusCodes.ACCEPTED).json({ reqId }); | ||
|
||
try { | ||
changeOwnership(req.body.collectionId, req.user.id); | ||
res.sse.sendTo({ reqId, data: [] }, 'collections'); | ||
} catch (error) { | ||
return next({ status: StatusCodes.MISDIRECTED_REQUEST, error }); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters