Start inserting game mod logs into D1
This commit is contained in:
@ -1,6 +1,5 @@
|
||||
import { getBanList } from "../../../roblox-open-cloud.js";
|
||||
import { jsonError, jsonResponse } from "../../../common.js";
|
||||
import { queryLogs } from "../../../gcloud.js";
|
||||
|
||||
export async function onRequestGet(context: RequestContext) {
|
||||
const robloxUserReq = await fetch(
|
||||
@ -52,12 +51,13 @@ export async function onRequestGet(context: RequestContext) {
|
||||
else if (banData.BanType === 2) current_status = "Banned";
|
||||
|
||||
const response = {
|
||||
history: (await queryLogs(users[0].id, context)).sort((a, b) =>
|
||||
a.entity.properties.executed_at.integerValue <
|
||||
b.entity.properties.executed_at.integerValue
|
||||
? 1
|
||||
: -1,
|
||||
),
|
||||
history: (
|
||||
await context.env.D1.prepare(
|
||||
"SELECT * FROM game_mod_logs WHERE target = ? ORDER BY executed_at DESC;",
|
||||
)
|
||||
.bind(users[0].id)
|
||||
.all()
|
||||
).results,
|
||||
user: {
|
||||
avatar: thumbnailRequest.ok
|
||||
? (
|
||||
|
Reference in New Issue
Block a user