Fix item deletion, delete from geleral item list
This commit is contained in:
parent
b0f730d162
commit
4f59f87fbf
|
@ -134,11 +134,14 @@ pub fn delete(self: Self, db: *Db) !void {
|
||||||
}
|
}
|
||||||
|
|
||||||
var item_sel = "item:----".*;
|
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
|
// Finally delete the item per se
|
||||||
// TODO: Return error on error
|
// TODO: Return error on error
|
||||||
_ = db.remove(&item_sel);
|
_ = 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 {
|
pub fn getById(id: []const u8, db: *Db, allocator: std.mem.Allocator) !?Self {
|
||||||
|
|
Loading…
Reference in New Issue