Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
bda9c0b
vanya
iSakha Jul 17, 2022
fde9288
Finished with fixtures movement
iSakha Jul 17, 2022
33408ba
some changes
iSakha Jul 18, 2022
6dc947d
vanya code review
iSakha Jul 19, 2022
1a050f2
Start with add equipment to the event
iSakha Jul 20, 2022
e85b9e3
commit
iSakha Jul 21, 2022
73301d4
Merge branch 'dev' of https://github.com/iSakha/BLACKOUT into dev
iSakha Jul 21, 2022
96fb52e
commit
iSakha Jul 21, 2022
3b2b07f
'selectFixturesByID' query created
iSakha Jul 21, 2022
1648aa9
commit
iSakha Jul 22, 2022
34a7fcd
commit
iSakha Jul 23, 2022
70b4062
fixed errors in equipController
iSakha Jul 23, 2022
15b7bb0
Merge branch 'dev' of https://github.com/iSakha/BLACKOUT into dev
iSakha Jul 23, 2022
9d29cf9
Get all equipment
iSakha Jul 23, 2022
9e912a4
All equip object sent to front created
iSakha Jul 23, 2022
b27e8f3
commit
iSakha Jul 23, 2022
c1331c7
Get fixtureObj
iSakha Jul 24, 2022
c95fe1f
commit
iSakha Jul 24, 2022
2c64d9f
changed idFixture,added one digit more
iSakha Jul 25, 2022
315f1fc
commit
iSakha Jul 26, 2022
f5064a5
Merge branch 'dev' of https://github.com/iSakha/BLACKOUT into dev
iSakha Jul 26, 2022
90c7ec2
work with new extended db
iSakha Jul 26, 2022
b348049
remove fixture shift
iSakha Jul 27, 2022
c8d5c2f
change status
iSakha Jul 27, 2022
77cebae
creating models transfer
iSakha Jul 27, 2022
a0a293d
commit
iSakha Jul 28, 2022
950a3fb
Merge branch 'dev' of https://github.com/iSakha/BLACKOUT into dev
iSakha Jul 28, 2022
300b0ba
Continue with model movement
iSakha Jul 28, 2022
c425038
finished with transfer
iSakha Jul 28, 2022
1fc05e6
commit
iSakha Jul 29, 2022
19cc053
add backup to gitignore
iSakha Jul 29, 2022
3dc889e
commit
iSakha Jul 31, 2022
4e362ab
Start with new query:" getFixturesByDepCat"
iSakha Aug 1, 2022
04aefb7
commit
iSakha Aug 1, 2022
6161f5f
getFixturesByDepCat
iSakha Aug 1, 2022
41f080c
commit
iSakha Aug 2, 2022
3980442
commit
iSakha Aug 2, 2022
3397e30
Merge branch 'dev' of https://github.com/iSakha/BLACKOUT into dev
iSakha Aug 2, 2022
7546960
work with 'deviceArr' sent to client
iSakha Aug 2, 2022
a46a621
commit
iSakha Aug 2, 2022
cab3ee4
commit
iSakha Aug 3, 2022
5c14dc3
commit
iSakha Aug 3, 2022
61fdb19
issue fixed
iSakha Aug 4, 2022
adcda5d
start with booking equipment
iSakha Aug 4, 2022
8aaa93d
start with booking calendar
iSakha Aug 4, 2022
a5e4e11
Write data to booking calendar finished
iSakha Aug 5, 2022
ce56ab2
Set and get booked models
iSakha Aug 6, 2022
efa33af
delete booked equipment
iSakha Aug 6, 2022
12cb0f6
Continue with booking
iSakha Aug 7, 2022
69b0376
Update GetOne event
iSakha Aug 10, 2022
d27f213
Add 'booking' to event queries
iSakha Aug 10, 2022
715fe83
Continue with 'booking'
iSakha Aug 11, 2022
ef7e1e4
Continue with 'booking'
iSakha Aug 11, 2022
7bf62cf
fixed empty arrays phase and booking
iSakha Aug 12, 2022
5472245
Create test modules
iSakha Aug 12, 2022
81350da
Fucking booking
iSakha Aug 12, 2022
f296b7e
changed constructor Event model
iSakha Aug 13, 2022
fdad3b7
Booking calendar
iSakha Aug 14, 2022
f622ced
commit
iSakha Aug 15, 2022
c0d2f37
fixing events issue
iSakha Aug 16, 2022
b15367f
commit
iSakha Aug 17, 2022
543d0e6
trying delete query
iSakha Aug 17, 2022
4c3d88c
continue with delete
iSakha Aug 18, 2022
b5223fe
commit
iSakha Aug 18, 2022
5c3f668
commit
iSakha Aug 18, 2022
65b8401
issue:delete query
iSakha Aug 18, 2022
baf80ff
delete: copyRow OK
iSakha Aug 19, 2022
cef977d
delete:copyRow,markEventDel => OK
iSakha Aug 19, 2022
5249560
delete:it seems it works
iSakha Aug 19, 2022
5823176
Finished with 'delete event'
iSakha Aug 22, 2022
96e1a8f
update:it seems it works
iSakha Aug 22, 2022
af44d87
start with booking
iSakha Aug 23, 2022
834b3cd
fixed issue
iSakha Aug 23, 2022
0266921
made booking query
iSakha Aug 24, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ node_modules/
img/
Queries/
Excel/
backup/
*.cashe
1 change: 1 addition & 0 deletions new_mvc/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@
# *.[oa]
# *~
node_modules/
backup/
img/
*.cashe
5 changes: 4 additions & 1 deletion new_mvc/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ const eventRouter = require("./routes/eventRouter");
const authRouter = require("./routes/authRouter");
const rootRouter = require("./routes/rootRouter");
const equipRouter = require("./routes/equipRouter");
const eventEquipRouter = require("./routes/eventEquipRouter");
const bookingRouter = require("./routes/bookingRouter");

// const PORT = 3070;
const PORT = process.env.PORT || 80;
Expand All @@ -21,7 +23,8 @@ app.use('/', rootRouter);
app.use('/events', eventRouter);
app.use('/login', authRouter);
app.use('/equip', equipRouter);

app.use('/eventequip', eventEquipRouter);
app.use('/booking', bookingRouter);


// S E R V E R
Expand Down
40 changes: 21 additions & 19 deletions new_mvc/controllers/authController.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,47 +41,49 @@ exports.validateUser = async (req, res) => {

const [row] = await auth.validateUser(req.body.login);

const dbUser = row[0];

console.log("row:", row);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here and in all pull request - remove console.log. They are needed only in development


if (row.length > 0) {
let passwordEnteredByUser = req.body.pass;
let salt = row[0].salt;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here and in all pull request - use const if variable will not be changed. If it's object - remember that properties could be changed in const

let salt = dbUser.salt;

console.log("salt:", salt);


if (bcrypt.hashSync(passwordEnteredByUser, salt) === row[0].crypto) {
if (bcrypt.hashSync(passwordEnteredByUser, salt) === dbUser.crypto) {

let user = {};
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const user = {}, const name = {} etc


user.id = row[0].id;
user.login = row[0].login;
user.id = dbUser.id;
user.login = dbUser.login;
let name = {};
name.firstName = row[0].firstName;
name.lastName = row[0].lastName;
name.patronymic = row[0].patrName;
name.fullName = row[0].fullName;
name.firstName = dbUser.firstName;
name.lastName = dbUser.lastName;
name.patronymic = dbUser.patrName;
name.fullName = dbUser.fullName;
user.name = name;
name.avatar = row[0].avatar;
name.avatar = dbUser.avatar;
let role = {};
role.id = row[0].idRole;
role.name = row[0].role;
role.id = dbUser.idRole;
role.name = dbUser.role;
user.role = role;
let contacts = {};
contacts.phone1 = row[0].phone1;
contacts.phone2 = row[0].phone2;
contacts.email = row[0].email;
contacts.phone1 = dbUser.phone1;
contacts.phone2 = dbUser.phone2;
contacts.email = dbUser.email;
user.contacts = contacts;
let warehouse = {};
warehouse.id = row[0].idWarehouse;
warehouse.name = row[0].warehouse;
warehouse.id = dbUser.idWarehouse;
warehouse.name = dbUser.warehouse;
user.warehouse = warehouse;
let department = {};
department.id = row[0].idDepartment;
department.name = row[0].department;
department.id = dbUser.idDepartment;
department.name = dbUser.department;
user.department = department;

console.log("row[0]:", row[0]);
console.log("dbUser:", dbUser);
console.log("user:", user);
const accessToken = jwt.sign({ username: user.username, role: user.role, id: user.id }, accessTokenSecret, { expiresIn: '120m' });
const refreshToken = jwt.sign({ username: user.username, role: user.role, id: user.id }, refreshTokenSecret);
Expand Down
Loading