aboutsummaryrefslogtreecommitdiff
path: root/invoice/service.go
diff options
context:
space:
mode:
Diffstat (limited to 'invoice/service.go')
-rw-r--r--invoice/service.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/invoice/service.go b/invoice/service.go
index 6b59949..cfb873f 100644
--- a/invoice/service.go
+++ b/invoice/service.go
@@ -51,6 +51,8 @@ func getInvoices(invoices *[]Invoice, userId uint) error {
return nil
}
+// TODO: route to only get the invouce's items
+
func (i *Invoice) upsert() error {
res := db.Save(i)
// TODO: handle potential errors
@@ -72,3 +74,9 @@ func (i *Invoice) del() error {
return nil
}
+
+func (i *InvoiceItem) upsert() error {
+ res := db.Save(i)
+ // TODO: handle potential errors
+ return res.Error
+}