Fix item deletion, delete from geleral item list

This commit is contained in:
Dendy 2022-11-05 04:41:38 +01:00
parent b0f730d162
commit 4f59f87fbf
1 changed files with 4 additions and 1 deletions

View File

@ -134,11 +134,14 @@ pub fn delete(self: Self, db: *Db) !void {
}
var item_sel = "item:----".*;
std.mem.copy(u8, item_sel[5..], id[0..]);
std.mem.copy(u8, item_sel[5..], &id);
// Finally delete the item per se
// TODO: Return error on error
_ = db.remove(&item_sel);
// Remove from the global item list
db.removeFromList("item", &id);
}
pub fn getById(id: []const u8, db: *Db, allocator: std.mem.Allocator) !?Self {