aboutsummaryrefslogtreecommitdiff
path: root/invoice/service.go
diff options
context:
space:
mode:
authorVidhu Kant Sharma <vidhukant@vidhukant.com>2023-12-04 01:46:17 +0530
committerVidhu Kant Sharma <vidhukant@vidhukant.com>2023-12-04 01:46:17 +0530
commita6087d0a4f177973b9d27e544f85736d90039089 (patch)
tree7f1edc54a6a1175552cbfbabf32283f37aa8bf32 /invoice/service.go
parentf169571cffeb3ac0404d56ac01ece90c33338113 (diff)
added API route to get drafts onlyv0.3.0
Diffstat (limited to 'invoice/service.go')
-rw-r--r--invoice/service.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/invoice/service.go b/invoice/service.go
index 9408a0d..91e2707 100644
--- a/invoice/service.go
+++ b/invoice/service.go
@@ -66,8 +66,8 @@ func getInvoice(invoice *Invoice, id uint) error {
return nil
}
-func getInvoices(invoices *[]Invoice, userId uint) error {
- res := db.Where("user_id = ?", userId).Find(&invoices)
+func getInvoices(invoices *[]Invoice, userId uint, isDraft bool) error {
+ res := db.Where("user_id = ? and is_draft = ?", userId, isDraft).Find(&invoices)
// TODO: handle potential errors
if res.Error != nil {