Skip to content

Commit

Permalink
change timestamp source
Browse files Browse the repository at this point in the history
  • Loading branch information
valentinarau committed Mar 7, 2024
1 parent e595763 commit 109f64d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pages/api/devices/samples.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { NextApiHandler, NextApiRequest, NextApiResponse } from 'next';
import availableMethodsHandler from '../../../utils/availableMethodsHandler';
import { onSampleUpload } from '../../../server/notifier/appNotifierService';
import { prismaClient } from '../../../server/prisma/client';
import { nowWithTimezone } from '../../../utils/dates';
import moment from 'moment';

const availableMethods = ['POST'];

Expand All @@ -25,7 +25,7 @@ async function postHandler(req: NextApiRequest, res: NextApiResponse): Promise<v
try {
const splitData = (req.body as string).split(';');
const [id, date, latitude, longitude] = splitData
const timestamp = nowWithTimezone();
const timestamp = moment(date, "YYYY-MM-DD h:mm:ss").toDate();
try {
const device = (await prismaClient.device.findUnique({
where: {
Expand Down

0 comments on commit 109f64d

Please sign in to comment.