Fixed mock-api for single employee requests
This commit is contained in:
@@ -58,6 +58,8 @@ router.render = (req, res) => {
|
||||
}
|
||||
|
||||
let data = res.locals.data;
|
||||
const employeeRegex = /(?:\/users\/)(.*)/;
|
||||
const isEmployeePath = employeeRegex.exec(pathname);
|
||||
const deltagareRegex = /(?:\/deltagare\/)(?:\d\/)(contact|driverlicense|educationlevels\/highest|educations|translator|work\/disabilities|work\/languages|work\/experiences)/g;
|
||||
const isDeltagarePath = deltagareRegex.exec(pathname);
|
||||
const avropRegex = /(?:\/avrop\/(?:tjanster|utforandeverksamheter|kommuner|\d))|(?:\/deltagare\/\d\/(avrop))/g;
|
||||
@@ -65,6 +67,10 @@ router.render = (req, res) => {
|
||||
const authRegex = /(?:\/auth\/)(userinfo|organizations)/g;
|
||||
const isAuthPath = authRegex.exec(pathname);
|
||||
|
||||
if (isEmployeePath) {
|
||||
data = data[0];
|
||||
}
|
||||
|
||||
if (isAuthPath) {
|
||||
const authSubPath = isAuthPath[1];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user