mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 22:57:21 +01:00
res.respond: allow for thrid parameter (message), refactor shared ops responses and adapt tests
This commit is contained in:
@@ -92,7 +92,14 @@ function _parseRes (res) {
|
||||
if (apiVersion === 'v2') {
|
||||
return res.body;
|
||||
} else if (apiVersion === 'v3') {
|
||||
return res.body.data;
|
||||
if (res.body.message) {
|
||||
return {
|
||||
data: res.body.data,
|
||||
message: res.body.message,
|
||||
};
|
||||
} else {
|
||||
return res.body.data;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user