fix: update match configuration to bestOf 5 and scoringType to score_v2
This commit is contained in:
36
build/server/chunks/_server.ts-DRKvzZ51.js
Normal file
36
build/server/chunks/_server.ts-DRKvzZ51.js
Normal file
@@ -0,0 +1,36 @@
|
||||
import { e as error, j as json } from './index-B2LGyy1l.js';
|
||||
import { l as leaveQueue, e as getQueueStatus, j as joinQueue } from './engine-DiCmv1C-.js';
|
||||
import { d as db, e as eq, j as teamMember } from './index2-B7hVh_Qf.js';
|
||||
import 'postgres';
|
||||
import './shared-server-DaWdgxVh.js';
|
||||
|
||||
const GET = async ({ locals }) => {
|
||||
if (!locals.user) error(401, "Not logged in");
|
||||
const status = await getQueueStatus(locals.user.id);
|
||||
return json(status);
|
||||
};
|
||||
const POST = async ({ locals }) => {
|
||||
if (!locals.user) error(401, "Not logged in");
|
||||
const membership = await db.query.teamMember.findFirst({
|
||||
where: eq(teamMember.userId, locals.user.id),
|
||||
with: { team: true }
|
||||
});
|
||||
const personalTeam = membership?.team;
|
||||
if (!personalTeam?.isPersonal) {
|
||||
error(400, "No personal team found");
|
||||
}
|
||||
try {
|
||||
const result = await joinQueue(locals.user.id, personalTeam.id);
|
||||
return json({ matched: !!result, match: result });
|
||||
} catch (e) {
|
||||
error(400, e.message);
|
||||
}
|
||||
};
|
||||
const DELETE = async ({ locals }) => {
|
||||
if (!locals.user) error(401, "Not logged in");
|
||||
await leaveQueue(locals.user.id);
|
||||
return json({ ok: true });
|
||||
};
|
||||
|
||||
export { DELETE, GET, POST };
|
||||
//# sourceMappingURL=_server.ts-DRKvzZ51.js.map
|
||||
Reference in New Issue
Block a user