Skip to content

Commit

Permalink
rename variables
Browse files Browse the repository at this point in the history
  • Loading branch information
christianmat committed Jan 6, 2024
1 parent 72a96d4 commit dc072a8
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions apps/server/src/entities/entities.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {ApiBearerAuth, ApiOperation, ApiResponse, ApiTags} from '@nestjs/swagger
import {EntitiesService} from './entities.service'

import {Actor, Entity} from './entities.interface'
import {HEADER_GLOBAL_STORAGE_INSTANCE_ID, HEADER_GLOBAL_STORAGE_USER_ID} from 'remote-storage'
import {HEADER_REMOTE_STORAGE_INSTANCE_ID, HEADER_REMOTE_STORAGE_USER_ID} from 'remote-storage'

const publicApiPrefix = '/entities/'

Expand Down Expand Up @@ -45,11 +45,11 @@ export class EntitiesController {
throw new BadRequestException('No headers provided')
}

const instanceId = headers[HEADER_GLOBAL_STORAGE_INSTANCE_ID]
const instanceId = headers[HEADER_REMOTE_STORAGE_INSTANCE_ID]
if (!instanceId) {
throw new BadRequestException('No instanceId provided')
}
const userId = headers[HEADER_GLOBAL_STORAGE_USER_ID]
const userId = headers[HEADER_REMOTE_STORAGE_USER_ID]
if (!userId) {
throw new BadRequestException('No userId provided')
}
Expand Down
8 changes: 4 additions & 4 deletions apps/server/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ const CORS_OPTIONS = {
'Accept',
'Content-Type',
'Authorization',
HEADER_GLOBAL_STORAGE_USER_ID,
HEADER_GLOBAL_STORAGE_INSTANCE_ID,
HEADER_REMOTE_STORAGE_USER_ID,
HEADER_REMOTE_STORAGE_INSTANCE_ID,
],
exposedHeaders: [
'Authorization',
HEADER_GLOBAL_STORAGE_USER_ID,
HEADER_GLOBAL_STORAGE_INSTANCE_ID,
HEADER_REMOTE_STORAGE_USER_ID,
HEADER_REMOTE_STORAGE_INSTANCE_ID,
],
credentials: true,
methods: ['GET', 'PUT', 'OPTIONS', 'POST', 'DELETE'],
Expand Down
4 changes: 2 additions & 2 deletions packages/js-client/src/core/constants.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export const HEADER_GLOBAL_STORAGE_INSTANCE_ID = 'x-remote-storage-instance-id'
export const HEADER_GLOBAL_STORAGE_USER_ID = 'x-remote-storage-user-id'
export const HEADER_REMOTE_STORAGE_INSTANCE_ID = 'x-remote-storage-instance-id'
export const HEADER_REMOTE_STORAGE_USER_ID = 'x-remote-storage-user-id'
4 changes: 2 additions & 2 deletions packages/js-client/src/core/remote-storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ export class RemoteStorage {
method: method,
headers: {
'Content-Type': 'application/json',
HEADER_GLOBAL_STORAGE_INSTANCE_ID: this.instanceId,
HEADER_GLOBAL_STORAGE_USER_ID: this.userId,
HEADER_REMOTE_STORAGE_INSTANCE_ID: this.instanceId,
HEADER_REMOTE_STORAGE_USER_ID: this.userId,
},
body: JSON.stringify(data),
})
Expand Down

0 comments on commit dc072a8

Please sign in to comment.