normativeai / backend

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

Cannot save query if theory not chosen #30

Closed lex-lex closed 5 years ago

lex-lex commented 5 years ago

When saving query without having selected a theory, the server returns an error {"err":"Query could not be found"}. I would consider this a bug; one could image writing a text into the editor field without having chosen the theory first.

shaolintl commented 5 years ago

@lex-lex I find it hard to replicate using tests. Might it be that you try to update a theory before creating it? The error is returned when the update didnt change any row in the db.

lex-lex commented 5 years ago

Ok, it seems it was an error in conjunction with the Vue representation of "none selected" list items; which is an empty string and not null or undefined; which could cause the backend to search for the theory with id "" (empty string), instead of ignoring it. I changed it to explicitly translate "" to undefined. Now it works.