InvTrack / invtrack

GNU General Public License v3.0
1 stars 1 forks source link

Prevent empty requests #222

Closed michalstruck closed 3 months ago

michalstruck commented 3 months ago

There's an improvement to be done request wise, it's not to send meaningless requests. For example in Parts.svelte, we have

 ...
 if (deleteParts) {
      genericUpdate(
...

The intention here was to check whether there was nothing to delete (or add, in case of newParts). Due to how JS type conversions work, this clause will do nothing - it'll always run. And that's because {new,delete}Parts are initialized as an empty array :D Check other places as well.

michalstruck commented 3 months ago

@Honsiu