Last active
September 15, 2020 07:54
-
-
Save emmsdan/2cb08b615834fd328c814ae33ef15707 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// <Route exact path="/staff/:staffId/:type" Component={StaffReference} /> | |
// type == personal or work | |
// GET: /api/v1/get-refer/:staffId/:type | |
const { staffId, type } = req.params; | |
let findRef; | |
if (type === 'personal'){ | |
findRef = await PersonalReference.findOne({ where: { staffId }}); | |
} else if (type === 'work') { | |
findRef = await WorkReference.findOne({ where: { staffId }}); | |
} | |
return res.json(findRef); | |
/* | |
* auto file response | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment