Skip to content
This repository was archived by the owner on Aug 21, 2024. It is now read-only.

Commit dde7c64

Browse files
LocationID addition (#9217)
* Aidan's fix * LocationID #7094 - Addition to LocationID because of previous miss * Remove pending tag if there's no renderer instance (#9215) * Remove pending tag if there's no renderer instance * remove log. --------- Co-authored-by: lonedevr <[email protected]>
1 parent 526fbe9 commit dde7c64

File tree

5 files changed

+12
-8
lines changed

5 files changed

+12
-8
lines changed

packages/client-core/src/social/services/LocationService.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ import { API } from '../../API'
3636
import { NotificationService } from '../../common/services/NotificationService'
3737

3838
export const LocationSeed: LocationType = {
39-
id: '',
39+
id: '' as LocationID,
4040
name: '',
4141
slugifiedName: '',
4242
maxUsersPerInstance: 10,

packages/engine/src/schemas/social/location.schema.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export type LocationID = OpaqueType<'LocationID'> & string
4646
// Main data model schema
4747
export const locationSchema = Type.Object(
4848
{
49-
id: Type.String({
49+
id: TypedString<LocationID>({
5050
format: 'uuid'
5151
}),
5252
name: Type.String(),

packages/server-core/src/social/location/location.hooks.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ const updateLocation = async (context: HookContext<LocationService>) => {
237237
await context.params
238238
.transaction!.trx!.from<LocationDatabaseType>(locationPath)
239239
.update(context.updateData)
240-
.where({ id: context.id?.toString() })
240+
.where({ id: context.id?.toString() as LocationID })
241241
}
242242

243243
const updateLocationSetting = async (context: HookContext<LocationService>) => {

packages/server-core/src/social/location/location.resolvers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ export const locationExternalResolver = resolve<LocationType, HookContext>({
7777

7878
export const locationDataResolver = resolve<LocationType, HookContext>({
7979
id: async () => {
80-
return v4()
80+
return v4() as LocationID
8181
},
8282
locationSetting: async (value, location) => {
8383
return {

packages/server-core/src/social/location/location.seed.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,19 @@ Ethereal Engine. All Rights Reserved.
2525

2626
import { Knex } from 'knex'
2727

28-
import { LocationDatabaseType, locationPath } from '@etherealengine/engine/src/schemas/social/location.schema'
28+
import {
29+
LocationDatabaseType,
30+
LocationID,
31+
locationPath
32+
} from '@etherealengine/engine/src/schemas/social/location.schema'
2933
import appConfig from '@etherealengine/server-core/src/appconfig'
3034

3135
import { SceneID } from '@etherealengine/engine/src/schemas/projects/scene.schema'
3236
import { getDateTimeSql } from '../../util/datetime-sql'
3337

3438
export const locationSeedData = [
3539
{
36-
id: '98cbcc30-fd2d-11ea-bc7c-cd4cac9a8d60',
40+
id: '98cbcc30-fd2d-11ea-bc7c-cd4cac9a8d60' as LocationID,
3741
name: 'Default',
3842
slugifiedName: 'default',
3943
maxUsersPerInstance: 30,
@@ -42,7 +46,7 @@ export const locationSeedData = [
4246
isLobby: false
4347
},
4448
{
45-
id: '98cbcc30-fd2d-11ea-bc7c-cd4cac9a8d62',
49+
id: '98cbcc30-fd2d-11ea-bc7c-cd4cac9a8d62' as LocationID,
4650
name: 'Sky Station',
4751
slugifiedName: 'sky-station',
4852
maxUsersPerInstance: 30,
@@ -51,7 +55,7 @@ export const locationSeedData = [
5155
isLobby: false
5256
},
5357
{
54-
id: '98cbcc30-fd2d-11ea-bc7c-cd4cac9a8d63',
58+
id: '98cbcc30-fd2d-11ea-bc7c-cd4cac9a8d63' as LocationID,
5559
name: 'Apartment',
5660
slugifiedName: 'apartment',
5761
maxUsersPerInstance: 30,

0 commit comments

Comments
 (0)