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

Commit

Permalink
fixed errors
Browse files Browse the repository at this point in the history
  • Loading branch information
MoizAdnan committed Jun 27, 2024
1 parent 18ea6a5 commit 153645d
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import InputText from '@etherealengine/client-core/src/common/components/InputTe
import {
LocationData,
LocationID,
LocationPatch,
locationPath,
LocationType,
staticResourcePath
Expand Down Expand Up @@ -215,7 +216,7 @@ const LocationDrawer = ({ open, mode, selectedLocation, selectedScene, onClose }
NotificationService.dispatchNotify(error.message, { variant: 'error' })
})
} else if (selectedLocation) {
locationMutation.patch(selectedLocation.id, data).catch((error) => {
locationMutation.patch(selectedLocation.id, data as LocationPatch).catch((error) => {
NotificationService.dispatchNotify(error.message, { variant: 'error' })
})
editMode.set(false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import { PopoverState } from '@etherealengine/client-core/src/common/services/Po
import {
LocationData,
LocationID,
LocationPatch,
locationPath,
LocationType,
staticResourcePath
Expand Down Expand Up @@ -118,7 +119,7 @@ export default function AddEditLocationModal({

try {
if (location?.id) {
await locationMutation.patch(location.id, locationData)
await locationMutation.patch(location.id, locationData as LocationPatch)
} else {
await locationMutation.create(locationData)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import {
scopeTypePath,
UserData,
UserName,
UserPatch,
userPath,
UserType
} from '@etherealengine/common/src/schema.type.module'
Expand Down Expand Up @@ -121,7 +122,7 @@ export default function AddEditUserModal({ user }: { user?: UserType }) {
submitLoading.set(true)
try {
if (user?.id) {
await userMutation.patch(user.id, userData)
await userMutation.patch(user.id, userData as UserPatch)
} else {
await userMutation.create(userData)
}
Expand Down
2 changes: 1 addition & 1 deletion packages/common/src/schemas/projects/project.schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export interface ProjectType extends Static<typeof projectSchema> {}
export interface ProjectDatabaseType extends Omit<ProjectType, 'settings'> {}

// Schema for creating new entries
export const projectDataSchema = Type.Partial(Type.Omit(projectSchema, ['id', 'createdAt', 'updatedAt']), {
export const projectDataSchema = Type.Partial(projectSchema, {
$id: 'ProjectData'
})
export interface ProjectData extends Static<typeof projectDataSchema> {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,13 @@ Ethereal Engine. All Rights Reserved.
import { createSwaggerServiceOptions } from 'feathers-swagger'

import {
locationSettingDataSchema,
locationSettingPatchSchema,
locationSettingQuerySchema,
locationSettingSchema
} from '@etherealengine/common/src/schemas/social/location-setting.schema'

export default createSwaggerServiceOptions({
schemas: {
locationSettingDataSchema,
locationSettingPatchSchema,
locationSettingQuerySchema,
locationSettingSchema
Expand Down
6 changes: 5 additions & 1 deletion packages/server-core/src/social/location/location.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import { LocationID, locationPath, LocationType } from '@etherealengine/common/s
import { destroyEngine } from '@etherealengine/ecs/src/Engine'

import { staticResourcePath } from '@etherealengine/common/src/schema.type.module'
import { getDateTimeSql } from '@etherealengine/common/src/utils/datetime-sql'
import { Application } from '../../../declarations'
import { createFeathersKoaApp } from '../../createApp'
import { LocationParams } from './location.class'
Expand Down Expand Up @@ -99,12 +100,15 @@ describe('location.test', () => {
it('should be able to update the location', async () => {
const newName = `Update Test Location ${uuidv4()}`
const locationSetting = await app.service(locationSettingPath).create({
id: uuidv4(),
locationType: 'public',
audioEnabled: true,
videoEnabled: true,
faceStreamingEnabled: false,
screenSharingEnabled: false,
locationId: locations[0].id
locationId: locations[0].id,
createdAt: await getDateTimeSql(),
updatedAt: await getDateTimeSql()
})

const locationData = JSON.parse(JSON.stringify(locations[0]))
Expand Down

0 comments on commit 153645d

Please sign in to comment.