Skip to content

Commit

Permalink
Merge pull request #17 from paywteam/feature/notifier
Browse files Browse the repository at this point in the history
hot fix for fragment save error
  • Loading branch information
ihooni authored Dec 2, 2019
2 parents 5e33868 + 969fd4b commit 9823efe
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/app/http/controllers/FragmentController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ export default class FragmentController {
return async (req, res): Promise<WGResponse> => {
// create a fragment
const fragment = await Fragment.create({
glueBoard: res.locals.glueBoard._id,
id: UIDGenerator.alphaNumericUID(16), // url id
url: await req.body.url,
selector: req.body.selector,
Expand Down Expand Up @@ -322,6 +323,9 @@ export default class FragmentController {
// link to new GlueBoard
transferGlueBoard.fragments.push(fragment._id)
await transferGlueBoard.save()

fragment.glueBoard = transferGlueBoard._id
await fragment.save()
}

return res.status(204).json()
Expand Down

0 comments on commit 9823efe

Please sign in to comment.