generated from GTBitsOfGood/nextjs-starter
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #213 from GTBitsOfGood/ash/183-deleteNewBuildingTypes
feat: flow for deleting building types
- Loading branch information
Showing
7 changed files
with
194 additions
and
41 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
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,23 @@ | ||
import { deleteBuildingTypeById } from "server/mongodb/actions/BuildingType"; | ||
import { withSessionRoute } from "src/lib/utils/session"; | ||
|
||
// @route DELETE api/card/delete | ||
// @desc Delete Card Request | ||
// @access Public | ||
const handler = async (req, res) => { | ||
try { | ||
const deletedType = await deleteBuildingTypeById(req.body); | ||
|
||
return res.status(200).json({ | ||
success: true, | ||
payload: deletedType, | ||
}); | ||
} catch (error) { | ||
res.status(400).json({ | ||
success: false, | ||
message: error.message, | ||
}); | ||
} | ||
}; | ||
|
||
export default withSessionRoute(handler); |
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
df4d6ec
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.
Deploy preview for southface ready!
✅ Preview
https://southface-7pefzdzpa-bitsofgood.vercel.app
Built with commit df4d6ec.
This pull request is being automatically deployed with vercel-action