Maybe fix et member updating?
This commit is contained in:
@@ -42,8 +42,7 @@ export async function onRequestPatch(context: RequestContext) {
|
|||||||
|
|
||||||
let queryData: { name?: string; roblox_id?: number } = {};
|
let queryData: { name?: string; roblox_id?: number } = {};
|
||||||
|
|
||||||
if (body.name?.length)
|
if (body.name?.length) queryData.name = body.name;
|
||||||
queryData = Object.defineProperty(queryData, "name", { value: body.name });
|
|
||||||
|
|
||||||
if (typeof body.roblox_username === "string" && body.roblox_username) {
|
if (typeof body.roblox_username === "string" && body.roblox_username) {
|
||||||
const robloxResolveResp = await fetch(
|
const robloxResolveResp = await fetch(
|
||||||
@@ -67,9 +66,7 @@ export async function onRequestPatch(context: RequestContext) {
|
|||||||
if (!data.length)
|
if (!data.length)
|
||||||
return jsonError("No Roblox user exists with that name", 400);
|
return jsonError("No Roblox user exists with that name", 400);
|
||||||
|
|
||||||
queryData = Object.defineProperty(queryData, "roblox_id", {
|
queryData.roblox_id = data[0].id;
|
||||||
value: data[0].id,
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
await context.data.prisma.etMember.update({
|
await context.data.prisma.etMember.update({
|
||||||
|
|||||||
Reference in New Issue
Block a user