rename shoppinglist fix
This commit is contained in:
		@@ -70,7 +70,7 @@ async function newShoppinglist(name, description, username, color) {
 | 
			
		||||
//rename Shoppinglist
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
async function renameShoppinglist(sl_id, newname, newdescription) {
 | 
			
		||||
async function renameShoppinglist(sl_id, newname, newdescription, newcolor) {
 | 
			
		||||
    try {
 | 
			
		||||
        let shoppinglist = await query('SELECT row_to_json("Shoppinglist") AS obj FROM "Shoppinglist" WHERE sl_id = $1;', [sl_id]);
 | 
			
		||||
        
 | 
			
		||||
@@ -81,6 +81,10 @@ async function renameShoppinglist(sl_id, newname, newdescription) {
 | 
			
		||||
        if(shoppinglist.description != newdescription) {
 | 
			
		||||
            await nonQuery('UPDATE "Shoppinglist" SET description = $1 WHERE sl_id = $2;', [newdescription, sl_id]);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if(shoppinglist.color != newcolor) {
 | 
			
		||||
            await nonQuery('UPDATE "Shoppinglist" SET color = $1 WHERE sl_id = $2;', [newcolor, sl_id]);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    catch (error) {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user