Skip to content

Commit

Permalink
fix(security.gblib): Params support in users.
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigorodriguez committed Feb 1, 2023
1 parent dc0fdc0 commit 82a9ba9
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .hintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"extends": [
"development"
]
}
6 changes: 5 additions & 1 deletion packages/security.gbapp/services/SecService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
3 changes: 1 addition & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"compilerOptions
": {
"compilerOptions": {
"allowJs": true,
"downlevelIteration": true,
"baseUrl": "./",
Expand Down

0 comments on commit 82a9ba9

Please sign in to comment.