Move the query event handlers into a subfolder and name them in a consistent way

This commit is contained in:
Oliver 2025-11-20 22:14:43 -07:00
parent 6a2cc1170d
commit c113c326c6
6 changed files with 38 additions and 32 deletions

View file

@ -0,0 +1,22 @@
import { addResponse, has as hasQuery } from "../../utils/QueryManager.mjs";
export function querySubmit(payload, user) {
const {
id,
answers,
} = payload;
if (!id) {
ui.notifications.error(game.i18n.format(
`taf.notifs.error.malformed-socket-payload`,
{
event: `query.submit`,
details: `A request ID must be provided`,
}),
);
return;
};
if (!hasQuery(id)) { return };
addResponse(id, user.id, answers);
};