check permission for pausing & unpausing research
All checks were successful
Build / build (18) (push) Successful in 47s
Build / build (18) (pull_request) Successful in 46s
Build / build (22) (push) Successful in 1m7s
Build / build (22) (pull_request) Successful in 42s
Build / build (20) (push) Successful in 1m6s
Build / build (20) (pull_request) Successful in 1m6s
All checks were successful
Build / build (18) (push) Successful in 47s
Build / build (18) (pull_request) Successful in 46s
Build / build (22) (push) Successful in 1m7s
Build / build (22) (pull_request) Successful in 42s
Build / build (20) (push) Successful in 1m6s
Build / build (20) (pull_request) Successful in 1m6s
This commit is contained in:
parent
a7f9832310
commit
e73c6e40eb
@ -193,6 +193,10 @@ export const guildTechController: RequestHandler = async (req, res) => {
|
|||||||
// Not a mistake: This response uses `inventoryChanges` instead of `InventoryChanges`.
|
// Not a mistake: This response uses `inventoryChanges` instead of `InventoryChanges`.
|
||||||
res.json({ inventoryChanges: inventoryChanges });
|
res.json({ inventoryChanges: inventoryChanges });
|
||||||
} else if (data.Action == "Pause") {
|
} else if (data.Action == "Pause") {
|
||||||
|
if (!hasAccessToDojo(inventory) || !(await hasGuildPermission(guild, accountId, GuildPermission.Tech))) {
|
||||||
|
res.status(400).send("-1").end();
|
||||||
|
return;
|
||||||
|
}
|
||||||
const project = guild.TechProjects!.find(x => x.ItemType == data.RecipeType)!;
|
const project = guild.TechProjects!.find(x => x.ItemType == data.RecipeType)!;
|
||||||
project.State = -2;
|
project.State = -2;
|
||||||
guild.ActiveDojoColorResearch = "";
|
guild.ActiveDojoColorResearch = "";
|
||||||
@ -200,6 +204,10 @@ export const guildTechController: RequestHandler = async (req, res) => {
|
|||||||
await removePigmentsFromGuildMembers(guild._id);
|
await removePigmentsFromGuildMembers(guild._id);
|
||||||
res.end();
|
res.end();
|
||||||
} else if (data.Action == "Unpause") {
|
} else if (data.Action == "Unpause") {
|
||||||
|
if (!hasAccessToDojo(inventory) || !(await hasGuildPermission(guild, accountId, GuildPermission.Tech))) {
|
||||||
|
res.status(400).send("-1").end();
|
||||||
|
return;
|
||||||
|
}
|
||||||
const project = guild.TechProjects!.find(x => x.ItemType == data.RecipeType)!;
|
const project = guild.TechProjects!.find(x => x.ItemType == data.RecipeType)!;
|
||||||
project.State = 0;
|
project.State = 0;
|
||||||
guild.ActiveDojoColorResearch = data.RecipeType;
|
guild.ActiveDojoColorResearch = data.RecipeType;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user