Skip to content

Commit e7b487d

Browse files
benjaminxiaagithub-actions[bot]
authored andcommitted
Format code
1 parent 327d6d6 commit e7b487d

3 files changed

Lines changed: 132 additions & 115 deletions

File tree

helpers/shop.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ export async function addShopItem(
142142
type: string
143143
): Promise<{ success: boolean; error?: string; item?: ShopItem }> {
144144
try {
145-
const item = await ShopItem.create({
145+
const item = (await ShopItem.create({
146146
name,
147147
description,
148148
image,
@@ -152,7 +152,7 @@ export async function addShopItem(
152152
},
153153
type,
154154
enabled: true
155-
}) as any;
155+
})) as any;
156156
return {
157157
success: true,
158158
item: {

package-lock.json

Lines changed: 106 additions & 91 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

routers/api/scouting.ts

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -735,28 +735,30 @@ router.get("/shop/inventory", requireScoutingAuth, async (ctx, next) => {
735735
});
736736

737737
router.post("/shop/item/add", requireScoutingAuth, async (ctx, next) => {
738-
let body = ctx.request.body as any;
739-
if (config.auth.adminTokens[body.adminToken] != null) {
740-
ctx.body = {
741-
success: true,
742-
body: {
743-
item: (await addShopItem(
744-
body.name,
745-
body.description,
746-
body.image,
747-
Number(body.priceBolts),
748-
Number(body.priceNuts),
749-
body.type
750-
)).item
751-
}
752-
};
753-
} else {
754-
ctx.body = {
755-
success: false,
756-
error: "Invalid admin token!"
757-
};
758-
}
759-
addAPIHeaders(ctx);
738+
let body = ctx.request.body as any;
739+
if (config.auth.adminTokens[body.adminToken] != null) {
740+
ctx.body = {
741+
success: true,
742+
body: {
743+
item: (
744+
await addShopItem(
745+
body.name,
746+
body.description,
747+
body.image,
748+
Number(body.priceBolts),
749+
Number(body.priceNuts),
750+
body.type
751+
)
752+
).item
753+
}
754+
};
755+
} else {
756+
ctx.body = {
757+
success: false,
758+
error: "Invalid admin token!"
759+
};
760+
}
761+
addAPIHeaders(ctx);
760762
});
761763

762764
export default router;

0 commit comments

Comments
 (0)