tipi-lang/examples/api/customer/controller.crud
2025-11-03 17:46:52 +01:00

23 lines
381 B
Text

#path(/id/{uuid})
fn get(uuid: uuid) -> Customer:
service.get(uuid)?or(404)
#path(?firstname={name})
fn get(name: string) -> Customer:
if name:
service.get(id)
else:
404
#path(/)
fn get() -> list:
service.get_all()
#path(/)
fn post(customer: Customer):
service.add(customer)
#path()
fn put(customer: Customer):
service.update(customer)