mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 14:47:53 +01:00
Preparatory Work for Smaller user doc (WIP) (#10245)
* protect all paths in user.pre(save using this.isDirectSelected to see if a field is available * fix linting * authWithHeaders: specify user fields to exclude instead of the ones to include, add comments, doc and improve test * add more options to unit helper generateReq and add tests for excluding fields in authWithHeaders
This commit is contained in:
@@ -54,10 +54,15 @@ export function generateReq (options = {}) {
|
||||
body: {},
|
||||
query: {},
|
||||
headers: {},
|
||||
header: sandbox.stub().returns(null),
|
||||
header (header) {
|
||||
return this.headers[header];
|
||||
},
|
||||
session: {},
|
||||
};
|
||||
|
||||
return defaultsDeep(options, defaultReq);
|
||||
const req = defaultsDeep(options, defaultReq);
|
||||
|
||||
return req;
|
||||
}
|
||||
|
||||
export function generateNext (func) {
|
||||
|
||||
Reference in New Issue
Block a user