From ed1b695996fa7f925dfa976eb0aeb709670b6512 Mon Sep 17 00:00:00 2001 From: mohjaps Date: Sun, 16 Oct 2022 15:41:57 +0300 Subject: [PATCH] User Roles --- server/database/config/fakeData.ts | 10 +++++----- server/models/User.ts | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/server/database/config/fakeData.ts b/server/database/config/fakeData.ts index a125e58..d35d909 100644 --- a/server/database/config/fakeData.ts +++ b/server/database/config/fakeData.ts @@ -5,7 +5,7 @@ const users = [ last_name: 'سعيد', email: 'jcotte0@people.com.cn', phone_number: '0591000100', - roles: 'admin', + role: 'admin', hased_password: '$2y$10$MKpnqAAinu5wjl/MYRc3U.XApWTaEexvI4DMaJA.XZTou5lvpSPfu', }, { @@ -14,7 +14,7 @@ const users = [ last_name: 'عمر', email: 'gbelt1@thetimes.co.uk', phone_number: '0591000200', - roles: 'user', + role: 'user', hased_password: '$2y$10$ROMcXqVNwbepoV6ZdTsTa.6/iego9a72vzSK70pF/S8Oxe/y8tLeO', }, { @@ -23,7 +23,7 @@ const users = [ last_name: 'عبد الله', email: 'tlobe2@angelfire.com', phone_number: '498-722-9258', - roles: 'user', + role: 'user', hased_password: '$2y$10$NrRa5y454oIukcfU/iNDruP2iEJPm9UGlHqyhZiyd5mY1fy2vULkG', }, { @@ -32,7 +32,7 @@ const users = [ last_name: 'محمد', email: 'mgravey3@slideshare.net', phone_number: '172-408-5906', - roles: 'user', + role: 'user', hased_password: '$2y$10$dOSPYdqciJCM9U10HiWtCOg9j6jpMD69rMPV/2LI/dDL4SxLATkNG', }, { @@ -41,7 +41,7 @@ const users = [ last_name: 'سليم', email: 'cscogin4@nytimes.com', phone_number: '910-220-7086', - roles: 'user', + role: 'user', hased_password: '$2y$10$6Y1AcLQDLM7vSSu1A5dj9e61YgCFACEXoBP3NxJ4qX/1SeUUXLFtm', }, ]; diff --git a/server/models/User.ts b/server/models/User.ts index 1b84052..421cbb9 100644 --- a/server/models/User.ts +++ b/server/models/User.ts @@ -31,7 +31,7 @@ const User = sequelize.define( unique: true, allowNull: false, }, - roles: { + role: { type: DataTypes.ENUM('admin', 'user'), allowNull: false, },