changed base path of REST api and updated frontend api quering

This commit is contained in:
2022-06-02 19:08:10 +02:00
parent cb74fe133c
commit f0ce8a615b
4 changed files with 15 additions and 12 deletions

View File

@@ -84,14 +84,14 @@
api.createNew(components[0],
parseInt(components[1].replace ( /[^\d.]/g, '' )),
components[1].replace(/[0-9]/g, ''))
.then( (response) => {
components[1].replace(/[0-9]/g, '') === 'ml' ? 'MILLILETERS' : "GRAMMS"
).then( (response) => {
this.$log.debug("New item created:", response);
this.items.push({
id: response.data.id,
name: components[0],
quantity: parseInt(components[1].replace ( /[^\d.]/g, '' )),
unit: components[1].replace(/[0-9]/g, '')
unit: components[1].replace(/[0-9]/g, '') === 'MILLILETERS' ? 'ml' : 'g'
})
}).catch((error) => {
this.$log.debug(error);