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 } = {};
|
||||
|
||||
if (body.name?.length)
|
||||
queryData = Object.defineProperty(queryData, "name", { value: body.name });
|
||||
if (body.name?.length) queryData.name = body.name;
|
||||
|
||||
if (typeof body.roblox_username === "string" && body.roblox_username) {
|
||||
const robloxResolveResp = await fetch(
|
||||
@@ -67,9 +66,7 @@ export async function onRequestPatch(context: RequestContext) {
|
||||
if (!data.length)
|
||||
return jsonError("No Roblox user exists with that name", 400);
|
||||
|
||||
queryData = Object.defineProperty(queryData, "roblox_id", {
|
||||
value: data[0].id,
|
||||
});
|
||||
queryData.roblox_id = data[0].id;
|
||||
}
|
||||
|
||||
await context.data.prisma.etMember.update({
|
||||
|
||||
Reference in New Issue
Block a user