Inventory Infrastructure and Example for Suits #10
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "inventory_basic"
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?
i dont think the comment is necessary
check if inventory is undefined before trying
toJson()
@ -1,11 +1,29 @@
import inventory from "@/static/fixed_responses/inventory.json";
/* eslint-disable @typescript-eslint/no-misused-promises */
import { toInventoryResponse } from "@/src/helpers/inventoryHelpers";
isnt disabled globally now?
use non-relative import
@ -0,0 +1,258 @@
import { Document, Schema, model } from "mongoose";
import { IInventoryDatabase, IInventoryResponse, ISuitDatabase, ISuitDocument, Oid } from "../types/inventoryTypes";
use non-relative import
use non-relative import
@ -1,11 +1,29 @@
import inventory from "@/static/fixed_responses/inventory.json";
/* eslint-disable @typescript-eslint/no-misused-promises */
import { toInventoryResponse } from "@/src/helpers/inventoryHelpers";
no idea it shouldn't be
it is important, because it is not present in the original response.
?. checks for undefined!
done
this comment doesn't explain nothing, it says its using accountOwnerId to find an inventory which is obvious.
@ -1,11 +1,29 @@
import inventory from "@/static/fixed_responses/inventory.json";
/* eslint-disable @typescript-eslint/no-misused-promises */
import { toInventoryResponse } from "@/src/helpers/inventoryHelpers";
then remove the one from .eslintrc
that's why you check before so you dont two undefined checks
it explains a lot.
I added the field accountOwnerId and everyone who knows the inventory structure would know the field is not originally there.
The purpose of the field is explained: it exists to find an account's corresponding inventory.
good suggestion!
I understand now what you mean
@ -1,11 +1,29 @@
import inventory from "@/static/fixed_responses/inventory.json";
/* eslint-disable @typescript-eslint/no-misused-promises */
import { toInventoryResponse } from "@/src/helpers/inventoryHelpers";
I agree with you that it is stupid to have the line in every file that has an async handler.
But I don't like to globally disable a warning. Ill turn the .eslintrc back on
should that belong then inside inventoryModel.ts?
@ -8,1 +14,3 @@
response.json(inventory);
const inventory = await Inventory.findOne({ accountOwnerId: accountId });
remove log