3 Commits

Author SHA1 Message Date
primakov c5a1f90816 1.2.3 2022-04-23 21:06:09 +03:00
primakov 3ec9ef0c91 add role on register 2022-04-23 21:05:58 +03:00
primakov 9f8feb5e40 add role on register 2022-04-23 21:05:51 +03:00
2 changed files with 3 additions and 1 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "red-coder-bh",
"version": "1.2.2",
"version": "1.2.3",
"description": "",
"main": "src/main.ts",
"scripts": {
+2
View File
@@ -3,6 +3,7 @@ import { Db } from 'mongodb'
import { mainDb } from '../../utils/mongo'
import { cleanId } from '../../utils/common'
import { usersCollection } from '../../__data__/constants'
import { Roles } from '../../model/roles'
export const registerUser = async ({ username, regtime, role, email, id, ...rest }) => {
const db: Db = await mainDb
@@ -11,6 +12,7 @@ export const registerUser = async ({ username, regtime, role, email, id, ...rest
const [registred] = await usersCl.find({ ijlId: id }).toArray()
const user = {
role: Roles.User,
...(registred || {}),
ijlId: id,
ijlUser: {