From 45a3b94f133ebcd9abff2baf266d0b3f691d2790 Mon Sep 17 00:00:00 2001 From: MikunoNaka Date: Sat, 1 May 2021 09:43:59 +0530 Subject: defined api group to handle DB functions regarding people/customers --- server/database/items.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'server/database/items.go') diff --git a/server/database/items.go b/server/database/items.go index d3d56fd..325b7c1 100644 --- a/server/database/items.go +++ b/server/database/items.go @@ -2,7 +2,6 @@ * OpenBills - Self hosted browser app to generate and keep track of simple invoices * Version - 0 * Licensed under the MIT license - https://opensource.org/licenses/MIT - * * Copyright (c) 2021 Vidhu Kant Sharma */ @@ -27,7 +26,7 @@ type Item struct { func GetAllItems() []Item { var allItems []Item rows, _ := myDatabase.Query( - `SELECT model, desc, price, hsn, gst, category, brand FROM registered_items`, + `SELECT Model, Desc, Price, Hsn, Gst, Category, Brand FROM Items`, ) var ( @@ -45,11 +44,11 @@ func GetAllItems() []Item { } func RegisterItem(item Item) bool { - itemNames, _ := myDatabase.Query("SELECT model FROM registered_items") + itemNames, _ := myDatabase.Query("SELECT model FROM Items") register_item, _ := myDatabase.Prepare( - `INSERT INTO registered_items - (model, desc, price, hsn, gst, category, brand) + `INSERT INTO Items + (Model, Desc, Price, Hsn, Gst, Category, Brand) VALUES (?, ?, ?, ?, ?, ?, ?)`, ) @@ -70,5 +69,6 @@ func RegisterItem(item Item) bool { item.GST, item.Cat, item.Brand, ) + return true } -- cgit v1.2.3