Merge pull request #1663 from thecodingmachine/fix/map_detail_type_guard
Fixing new MapDetails type guard
This commit is contained in:
commit
e086f6dac0
@ -9,13 +9,13 @@ import { isNumber } from "generic-type-guard";
|
|||||||
|
|
||||||
export const isMapDetailsData = new tg.IsInterface()
|
export const isMapDetailsData = new tg.IsInterface()
|
||||||
.withProperties({
|
.withProperties({
|
||||||
roomSlug: tg.isOptional(tg.isString), // deprecated
|
|
||||||
mapUrl: tg.isString,
|
mapUrl: tg.isString,
|
||||||
policy_type: isNumber, //isNumericEnum(GameRoomPolicyTypes),
|
policy_type: isNumber, //isNumericEnum(GameRoomPolicyTypes),
|
||||||
tags: tg.isArray(tg.isString),
|
tags: tg.isArray(tg.isString),
|
||||||
textures: tg.isArray(isCharacterTexture),
|
textures: tg.isArray(isCharacterTexture),
|
||||||
contactPage: tg.isUnion(tg.isString, tg.isUndefined),
|
authenticationMandatory: tg.isUnion(tg.isNullable(tg.isBoolean), tg.isUndefined),
|
||||||
authenticationMandatory: tg.isUnion(tg.isBoolean, tg.isUndefined),
|
roomSlug: tg.isNullable(tg.isString), // deprecated
|
||||||
|
contactPage: tg.isNullable(tg.isString),
|
||||||
group: tg.isNullable(tg.isString),
|
group: tg.isNullable(tg.isString),
|
||||||
})
|
})
|
||||||
.withOptionalProperties({
|
.withOptionalProperties({
|
||||||
|
@ -59,11 +59,11 @@ export class MapController extends BaseController {
|
|||||||
JSON.stringify({
|
JSON.stringify({
|
||||||
mapUrl,
|
mapUrl,
|
||||||
policy_type: GameRoomPolicyTypes.ANONYMOUS_POLICY,
|
policy_type: GameRoomPolicyTypes.ANONYMOUS_POLICY,
|
||||||
roomSlug: "", // Deprecated
|
roomSlug: null, // Deprecated
|
||||||
group: null,
|
group: null,
|
||||||
tags: [],
|
tags: [],
|
||||||
textures: [],
|
textures: [],
|
||||||
contactPage: undefined,
|
contactPage: null,
|
||||||
authenticationMandatory: DISABLE_ANONYMOUS,
|
authenticationMandatory: DISABLE_ANONYMOUS,
|
||||||
} as MapDetailsData)
|
} as MapDetailsData)
|
||||||
);
|
);
|
||||||
|
Loading…
Reference in New Issue
Block a user