Skip to content

Commit

Permalink
Update apps/civicsignalblog/src/payload/collections/Users.js
Browse files Browse the repository at this point in the history
Co-authored-by: Clemence Kyara <[email protected]>
  • Loading branch information
m453h and kilemensi committed Sep 25, 2024
1 parent 3774f14 commit 4b38fdb
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions apps/civicsignalblog/src/payload/collections/Users.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,22 +90,19 @@ const Users = {
});
}

const userId = req.user.id;

const { selectedApp } = req.body;

if (!selectedApp) {
res.status(400).send({
error: `Incorrect message format was received:${JSON.stringify(req.body)}`,
});
}

const userId = req.user.id;
const currentUser = await payload.findByID({
collection: "users",
id: userId,
showHiddenFields: true,
});

if (!currentUser) {
res
.status(404)
Expand All @@ -119,7 +116,6 @@ const Users = {
currentApp: selectedApp || currentUser.defaultApp,
},
});

res.status(200).send({
message: "Application updated successfully",
currentApp: updatedUser.currentApp,
Expand Down

0 comments on commit 4b38fdb

Please sign in to comment.