Skip to content

Commit

Permalink
bg(validations): fix trip creation validations
Browse files Browse the repository at this point in the history
  • Loading branch information
hezronkimutai committed Feb 20, 2020
1 parent 5cd1b52 commit 0a11773
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/services/TripService.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ class TripService {
const managerRequestsObj = {
where: { userId: user.userId, statusId: 1 },
attributes: ['id', 'updatedAt', 'createdAt'],
order: [
['updatedAt', 'DESC'],
],
include: [
{
model: trips,
Expand Down Expand Up @@ -120,7 +123,9 @@ class TripService {
static async getUserRequests(req) {
const requestsUsersObject = {
where: { userId: req.user.id },

order: [
['updatedAt', 'DESC'],
],
include: [{
model: trips,
},
Expand Down
7 changes: 6 additions & 1 deletion src/services/UserService.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { users, roles, userProfile, blacklist } from '../database/models';
import {
users, roles, userProfile, blacklist
} from '../database/models';
import CommonQueries from './CommonQueries';
import HashPassword from '../helpers/HashPassword';
/**
Expand Down Expand Up @@ -74,6 +76,9 @@ class UserService {
static async availableUsers() {
const allUsersObj = {
attributes: ['id', 'firstName', 'lastName', 'email', 'roleId'],
order: [
['updatedAt', 'DESC'],
],
include: [
{
model: roles,
Expand Down

0 comments on commit 0a11773

Please sign in to comment.