Skip to content

Commit 88a9af8

Browse files
committed
feat(backend): update device routes to include user context
1 parent 42afcc0 commit 88a9af8

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

services/backend/api-spec.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4574,7 +4574,7 @@
45744574
}
45754575
}
45764576
},
4577-
"/api/devices": {
4577+
"/api/me/devices": {
45784578
"get": {
45794579
"summary": "List my devices",
45804580
"tags": [
@@ -4757,7 +4757,7 @@
47574757
}
47584758
}
47594759
},
4760-
"/api/devices/{deviceId}": {
4760+
"/api/me/devices/{deviceId}": {
47614761
"get": {
47624762
"summary": "Get device details",
47634763
"tags": [

services/backend/api-spec.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3154,7 +3154,7 @@ paths:
31543154
- success
31553155
- error
31563156
description: Internal server error
3157-
/api/devices:
3157+
/api/me/devices:
31583158
get:
31593159
summary: List my devices
31603160
tags:
@@ -3287,7 +3287,7 @@ paths:
32873287
- success
32883288
- error
32893289
description: Internal Server Error
3290-
/api/devices/{deviceId}:
3290+
/api/me/devices/{deviceId}:
32913291
get:
32923292
summary: Get device details
32933293
tags:

services/backend/src/routes/users/me/devices/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ export default async function userDevicesRoute(server: FastifyInstance) {
114114
const deviceService = new DeviceService(server.db);
115115

116116
// GET /api/users/me/devices - List user's devices
117-
server.get('/devices', {
117+
server.get('/me/devices', {
118118
preValidation: requireAuthentication(),
119119
schema: {
120120
tags: ['User Devices'],
@@ -158,7 +158,7 @@ export default async function userDevicesRoute(server: FastifyInstance) {
158158
});
159159

160160
// GET /api/users/me/devices/:deviceId - Get specific device
161-
server.get('/devices/:deviceId', {
161+
server.get('/me/devices/:deviceId', {
162162
preValidation: requireAuthentication(),
163163
schema: {
164164
tags: ['User Devices'],
@@ -225,7 +225,7 @@ export default async function userDevicesRoute(server: FastifyInstance) {
225225
});
226226

227227
// PUT /api/users/me/devices/:deviceId - Update device
228-
server.put('/devices/:deviceId', {
228+
server.put('/me/devices/:deviceId', {
229229
preValidation: requireAuthentication(),
230230
schema: {
231231
tags: ['User Devices'],
@@ -308,7 +308,7 @@ export default async function userDevicesRoute(server: FastifyInstance) {
308308
});
309309

310310
// DELETE /api/users/me/devices/:deviceId - Remove device
311-
server.delete('/devices/:deviceId', {
311+
server.delete('/me/devices/:deviceId', {
312312
preValidation: requireAuthentication(),
313313
schema: {
314314
tags: ['User Devices'],

0 commit comments

Comments
 (0)