mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 15:17:25 +01:00
v3: fix iap url
This commit is contained in:
@@ -95,7 +95,7 @@ api.iapAndroidVerify = {
|
|||||||
**/
|
**/
|
||||||
api.iapiOSVerify = {
|
api.iapiOSVerify = {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
url: '/iap/android/verify',
|
url: '/iap/ios/verify',
|
||||||
middlewares: [authWithHeaders()],
|
middlewares: [authWithHeaders()],
|
||||||
async handler (req, res) {
|
async handler (req, res) {
|
||||||
let iapBody = req.body;
|
let iapBody = req.body;
|
||||||
|
|||||||
@@ -60,6 +60,9 @@ module.exports = function baseModel (schema, options = {}) {
|
|||||||
objectPath.del(plainObj, fieldPath);
|
objectPath.del(plainObj, fieldPath);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Always return `id`
|
||||||
|
if (!plainObj.id && plainObj._id) plainObj.id = plainObj._id;
|
||||||
|
|
||||||
// Allow an additional toJSON transform function to be used
|
// Allow an additional toJSON transform function to be used
|
||||||
return options.toJSONTransform ? options.toJSONTransform(plainObj, doc) : plainObj;
|
return options.toJSONTransform ? options.toJSONTransform(plainObj, doc) : plainObj;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -529,9 +529,7 @@ schema.plugin(baseModel, {
|
|||||||
noSet: [],
|
noSet: [],
|
||||||
private: ['auth.local.hashed_password', 'auth.local.salt'],
|
private: ['auth.local.hashed_password', 'auth.local.salt'],
|
||||||
toJSONTransform: function userToJSON (plainObj, originalDoc) {
|
toJSONTransform: function userToJSON (plainObj, originalDoc) {
|
||||||
plainObj.id = plainObj._id;
|
// plainObj.filters = {}; // TODO Not saved, remove?
|
||||||
|
|
||||||
// plainObj.filters = {}; TODO Not saved, remove?
|
|
||||||
plainObj._tmp = originalDoc._tmp; // be sure to send down drop notifs
|
plainObj._tmp = originalDoc._tmp; // be sure to send down drop notifs
|
||||||
|
|
||||||
return plainObj;
|
return plainObj;
|
||||||
|
|||||||
Reference in New Issue
Block a user