web: EntryProposal form implementation.
This commit is contained in:
@ -10,6 +10,11 @@ type
|
||||
date*: DateTime
|
||||
budgetInDollars*: int
|
||||
|
||||
MultiSelectOption = tuple[value: string, color: string]
|
||||
|
||||
EventProposalConfig* = object
|
||||
departmentOptions*: seq[MultiSelectOption]
|
||||
|
||||
proc getOrFail(n: JsonNode, key: string): JsonNode =
|
||||
## convenience method to get a key from a JObject or raise an exception
|
||||
if not n.hasKey(key):
|
||||
@ -75,3 +80,14 @@ proc asNotionPage*(ep: EventProposal): JsonNode =
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
proc `%`(mso: MultiSelectOption): JsonNode =
|
||||
%*{
|
||||
"value": mso.value,
|
||||
"color": mso.color
|
||||
}
|
||||
|
||||
proc `%`*(epc: EventProposalConfig): JsonNode =
|
||||
%*{
|
||||
"departments": epc.departmentOptions
|
||||
}
|
||||
|
Reference in New Issue
Block a user