delete /group
Gruppe mit allen Items löschen
This commit is contained in:
		@@ -203,6 +203,21 @@ async function editItem(sl_id, group_id, item_id, name, count) {
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
//Delete Group
 | 
			
		||||
 | 
			
		||||
async function deleteGroup(group_id, sl_id) {
 | 
			
		||||
    try {
 | 
			
		||||
        //Alle Items der Group löschen
 | 
			
		||||
        nonQuery('DELETE FROM "Item" WHERE group_id = $1 AND sl_id = $2', [group_id, sl_id]);
 | 
			
		||||
 | 
			
		||||
        //Leere Gruppe löschen
 | 
			
		||||
        nonQuery('DELETE FROM "Group" WHERE group_id = $1 AND sl_id = $2', [group_id, sl_id]);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    catch (error) {
 | 
			
		||||
        console.error(error);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@@ -312,5 +327,5 @@ function generateInviteLink() {
 | 
			
		||||
 | 
			
		||||
module.exports = {
 | 
			
		||||
    getShoppinglistsAdmin, getShoppinglistsShared, newShoppinglist, displayShoppinglist, deleteShoppinglist, addGroup,
 | 
			
		||||
    addItem, verifyInvite, createInvite, editShoppinglist, editGroup, editItem
 | 
			
		||||
    addItem, verifyInvite, createInvite, editShoppinglist, editGroup, editItem, deleteGroup
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user