Move the query event handlers into a subfolder and name them in a consistent way
This commit is contained in:
parent
6a2cc1170d
commit
c113c326c6
6 changed files with 38 additions and 32 deletions
|
|
@ -1,22 +0,0 @@
|
|||
import { addResponse, has as hasQuery } from "../utils/QueryManager.mjs";
|
||||
|
||||
export function submitRequest(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);
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue