fix(security.gblib): Params support in users.

This commit is contained in:
rodrigorodriguez 2023-01-31 23:11:06 -03:00
parent dc0fdc0564
commit 82a9ba983e
3 changed files with 11 additions and 3 deletions

5
.hintrc Normal file
View file

@ -0,0 +1,5 @@
{
"extends": [
"development"
]
}

View file

@ -271,10 +271,14 @@ export class SecService extends GBService {
*/
public async setParam (userId: number, name: string, value:any) {
const options = { where: {} };
options.where = { botId: userId };
options.where = { userId: userId };
let user = await GuaribasUser.findOne(options);
// tslint:disable-next-line:prefer-object-spread
let obj = JSON.parse(user.params);
if (!obj)
{
obj = {};
}
obj['name'] = value;
user.params = JSON.stringify(obj);
return await user.save();

View file

@ -1,6 +1,5 @@
{
"compilerOptions
": {
"compilerOptions": {
"allowJs": true,
"downlevelIteration": true,
"baseUrl": "./",