mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 14:47:53 +01:00
fix mongoose issue
This commit is contained in:
@@ -91,7 +91,7 @@
|
|||||||
"client:build": "cd website/client && npm run build",
|
"client:build": "cd website/client && npm run build",
|
||||||
"client:unit": "cd website/client && npm run test:unit",
|
"client:unit": "cd website/client && npm run test:unit",
|
||||||
"start": "gulp nodemon",
|
"start": "gulp nodemon",
|
||||||
"postinstall": "gulp build",
|
"postinstall": "gulp build && cd website/client && npm install",
|
||||||
"apidoc": "gulp apidoc"
|
"apidoc": "gulp apidoc"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
|||||||
@@ -61,15 +61,4 @@ describe('POST /user/push-devices', () => {
|
|||||||
expect(user.pushDevices[0].type).to.equal(type);
|
expect(user.pushDevices[0].type).to.equal(type);
|
||||||
expect(user.pushDevices[0].regId).to.equal(regId);
|
expect(user.pushDevices[0].regId).to.equal(regId);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('removes a push device to the user', async () => {
|
|
||||||
await user.post('/user/push-devices', { type, regId });
|
|
||||||
|
|
||||||
const response = await user.del(`/user/push-devices/${regId}`);
|
|
||||||
await user.sync();
|
|
||||||
|
|
||||||
expect(response.message).to.equal(t('pushDeviceRemoved'));
|
|
||||||
expect(response.data[0]).to.not.exist;
|
|
||||||
expect(user.pushDevices[0]).to.not.exist;
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
"serve": "vue-cli-service serve",
|
"serve": "vue-cli-service serve",
|
||||||
"build": "vue-cli-service build",
|
"build": "vue-cli-service build",
|
||||||
"test:unit": "vue-cli-service test:unit --opts ../../test/mocha.opts",
|
"test:unit": "vue-cli-service test:unit --opts ../../test/mocha.opts",
|
||||||
"lint": "vue-cli-service lint --quiet"
|
"lint": "vue-cli-service lint"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"amplitude-js": "^5.3.1",
|
"amplitude-js": "^5.3.1",
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ api.removePushDevice = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Concurrency safe update
|
// Concurrency safe update
|
||||||
const pullQuery = { $pull: { pushDevices: { $elemMatch: { regId } } } };
|
const pullQuery = { $pull: { pushDevices: { regId } } };
|
||||||
await user.update(pullQuery).exec();
|
await user.update(pullQuery).exec();
|
||||||
|
|
||||||
// Update the response
|
// Update the response
|
||||||
|
|||||||
Reference in New Issue
Block a user