Skip to content

Commit

Permalink
fix: 🐛 Corrige bug na exibição da camada de câmeras
Browse files Browse the repository at this point in the history
  • Loading branch information
victorassiso committed Nov 22, 2024
1 parent 511b6cd commit 98afe2b
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 97 deletions.
15 changes: 12 additions & 3 deletions src/http/cameras/get-cameras.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
'use server'

import { api } from '@/lib/api'
import type { Camera } from '@/models/entities'
import type { Camera, RawCamera } from '@/models/entities'

export async function getCameras() {
const response = await api.get<Camera[]>('/camera')
const response = await api.get<RawCamera[]>('/camera')

return response.data
const cameras: Camera[] = response.data.map((camera) => ({
id: camera.CameraCode,
name: camera.CameraName,
zone: camera.CameraZone,
latitude: Number(camera.Latitude),
longitude: Number(camera.Longitude),
streamingUrl: camera.Streamming,
}))

return cameras
}
35 changes: 0 additions & 35 deletions src/server-cache/cameras.ts

This file was deleted.

25 changes: 0 additions & 25 deletions src/server-cache/models.ts

This file was deleted.

34 changes: 0 additions & 34 deletions src/server-cache/projects.ts

This file was deleted.

0 comments on commit 98afe2b

Please sign in to comment.