diff options
| author | Marius Peter <dev@marius-peter.com> | 2025-12-10 18:35:37 +0100 |
|---|---|---|
| committer | Marius Peter <dev@marius-peter.com> | 2025-12-10 18:35:37 +0100 |
| commit | dd05a730876e668bf522f854963db9632e474244 (patch) | |
| tree | 225aa2c0e96f7b7d3814e8fe1e9ccc161c247045 | |
| parent | ff3aae7a4d816bc1964de5f97ee35e3d07566c8a (diff) | |
Simplify function argument combinatorial.
| -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 |