MissionInventoryUpdate(not completed), Mod upgrade, Booster purchase #49
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "interface-names"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@ -53,0 +59,4 @@
combineRewardAndLootInventory(InventoryChanges, lootInventory);
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const InventoryJson = JSON.stringify(await missionInventoryUpdate(combinedInventoryChanges, id));
can you seperate interfaces into seperate files? we got the /types folder, for example string dictionary could be in /types/commonTypes.ts
@ -53,0 +59,4 @@
combineRewardAndLootInventory(InventoryChanges, lootInventory);
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const InventoryJson = JSON.stringify(await missionInventoryUpdate(combinedInventoryChanges, id));
is this the best way? looks a bit suspicious with the many else ifs
@ -53,0 +59,4 @@
combineRewardAndLootInventory(InventoryChanges, lootInventory);
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const InventoryJson = JSON.stringify(await missionInventoryUpdate(combinedInventoryChanges, id));
need that like this for now
If you could, add an "I" before your interface names to match the rest of the project. My push fixes all of the ones applied before this pull, among other things, to match the code elsewhere in the project, which is the preferred style.
@ -53,0 +52,4 @@
if (typeof lootInventory !== "object" || lootInventory === null) {
throw new Error("Invalid data format");
}
what is the purpose of this?
can you explain what the difference is between missioncredits and MissionCredits?
can you please use brackets like:
if (something){
expression;
}
it makes it easier to read
where possible: instead of "i" or "j" use descriptive names such as rawUpgrade or so
perhaps make a function for this logic.
A controller should only "control" the calling of functions, with as little logic as possible.
You could make a service/missionInventoryUpdateService and put all the logic there, while you call those functions from the controller. Some logic in the controller is totally fine.
move types and interfaces into types/missionInventoryTypes
@ -53,0 +59,4 @@
combineRewardAndLootInventory(InventoryChanges, lootInventory);
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const InventoryJson = JSON.stringify(await missionInventoryUpdate(combinedInventoryChanges, id));
and you could make a types/missionInventoryUpdatesTypes.ts as well
instead of this use /types/commonTypes Oid type