diff options
| author | Vidhu Kant Sharma <vidhukant@vidhukant.com> | 2023-10-09 21:07:20 +0530 | 
|---|---|---|
| committer | Vidhu Kant Sharma <vidhukant@vidhukant.com> | 2023-10-09 21:07:20 +0530 | 
| commit | 1924bfca2439829253df3598481034e5c586e3e2 (patch) | |
| tree | 6b82a091ae97e1980fe0ff3f3fb3eaa726a6d6ad /invoice/service.go | |
| parent | b643f7852f93f73843aa5f52f9b4545321713e10 (diff) | |
added route to add items to invoice
Diffstat (limited to 'invoice/service.go')
| -rw-r--r-- | invoice/service.go | 8 | 
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 +}  |