Skip to content
Snippets Groups Projects
Commit 0a2ce1fc authored by Zijing Wei's avatar Zijing Wei
Browse files

feat: update date info

parent 50778ca5
No related branches found
No related tags found
No related merge requests found
......@@ -30,7 +30,7 @@ export class AppController {
@Post('pingPong')
async createPingPong(
@Body() postData: { source_ip: string; ping_time: string; pong_time: string; latency: number },
@Body() postData: { source_ip: string; ping_time: any; pong_time: any; latency: number },
): Promise<PingPongModel> {
const { source_ip, ping_time, pong_time, latency } = postData;
return this.pingPongService.createPingPong({
......
......@@ -32,8 +32,14 @@ export class PingPongService {
}
async createPingPong(data: Prisma.PingPongCreateInput): Promise<PingPong> {
return this.prisma.pingPong.create({
data,
data: {
source_ip: data.source_ip,
ping_time: new Date(data.ping_time),
pong_time: new Date(data.pong_time),
latency: data.latency
},
});
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment