Skip to content

Commit

Permalink
feat: add cira timestampes to db
Browse files Browse the repository at this point in the history
  • Loading branch information
Walt-Intel committed Nov 7, 2023
1 parent 4c6c422 commit 61619dd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/data/postgres/tables/device.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import { DeviceTable } from './device'
import { type Device } from '../../../models/models'
import PostgresDb from '..'
import { MPSValidationError } from '../../../utils/MPSValidationError'
// import { MPSValidationError } from '../../../utils/MPSValidationError'

describe('device tests', () => {
let db: PostgresDb
Expand Down Expand Up @@ -358,7 +358,7 @@ describe('device tests', () => {
// const result = await deviceTable.insert(device)
// expect(querySpy).toBeCalledTimes(1)
// expect(querySpy).toBeCalledWith(`
// INSERT INTO devices(guid, hostname, tags, mpsinstance, connectionstatus, mpsusername, tenantid, friendlyname, dnssuffix, deviceinfo)
// INSERT INTO devices(guid, hostname, tags, mpsinstance, connectionstatus, mpsusername, tenantid, friendlyname, dnssuffix, deviceinfo)
// values($1, $2, ARRAY(SELECT json_array_elements_text($3)), $4, $5, $6, $7, $8, $9, $10)`,
// [
// device.guid,
Expand Down Expand Up @@ -394,7 +394,7 @@ describe('device tests', () => {
// const result = await deviceTable.insert(device)
// expect(querySpy).toBeCalledTimes(1)
// expect(querySpy).toBeCalledWith(`
// INSERT INTO devices(guid, hostname, tags, mpsinstance, connectionstatus, mpsusername, tenantid, friendlyname, dnssuffix, deviceinfo)
// INSERT INTO devices(guid, hostname, tags, mpsinstance, connectionstatus, mpsusername, tenantid, friendlyname, dnssuffix, deviceinfo)
// values($1, $2, ARRAY(SELECT json_array_elements_text($3)), $4, $5, $6, $7, $8, $9, $10)`,
// [
// device.guid,
Expand Down Expand Up @@ -521,7 +521,7 @@ describe('device tests', () => {
// const result = await deviceTable.update(device)
// expect(querySpy).toBeCalledTimes(1)
// expect(querySpy).toBeCalledWith(`
// UPDATE devices
// UPDATE devices
// SET tags=$2, hostname=$3, mpsinstance=$4, connectionstatus=$5, mpsusername=$6, friendlyname=$8, dnssuffix=$9, deviceinfo=$10
// WHERE guid=$1 and tenantid = $7`,
// [
Expand Down
2 changes: 1 addition & 1 deletion src/routes/devices/deviceValidator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export const validator = (): any => [
check('mpsusername')
.optional({ nullable: true })
.isString(),
check('connect')
check('connect')
.optional({ nullable: true })
.isISO8601().toDate(),
check('disconnect')
Expand Down

0 comments on commit 61619dd

Please sign in to comment.