diff options
| -rw-r--r-- | models/crop-requirement.rkt | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/models/crop-requirement.rkt b/models/crop-requirement.rkt index 96d94cf..018c6c1 100644 --- a/models/crop-requirement.rkt +++ b/models/crop-requirement.rkt @@ -90,15 +90,14 @@ #:group '#(0 1 2))) (map grouped-row->crop-requirement grouped-rows)) -(define (get-crop-requirement #:id [cr-id #f] #:profile [profile #f] #:crop-id [crop-id #f]) +(define (get-crop-requirement #:id [cr-id #f] #:profile [profile #f]) (define where (cond - [(and cr-id profile crop-id) - (scalar-expr-qq (and (= cr.id ,cr-id) (= cr.profile ,profile) (= cr.crop_id ,crop-id)))] + [(and cr-id profile) + (scalar-expr-qq (and (= cr.id ,cr-id) (= cr.profile ,profile)))] [cr-id (scalar-expr-qq (= cr.id ,cr-id))] [profile (scalar-expr-qq (= cr.profile ,profile))] - [crop-id (scalar-expr-qq (= cr.crop_id ,crop-id))] - [else (error 'get-crop-requirement "one of #:id, #:profile or #:crop-id must be provided")])) + [else (error 'get-crop-requirement "one of #:id or #:profile must be provided")])) (define grouped-rows (query-rows (current-conn) (select cr.id |