17 lines
435 B
Text
17 lines
435 B
Text
fn get():
|
|
| path == "/" -> list:
|
|
service.get_all()
|
|
| path == "/{uuid}" -> Customer?:
|
|
service.get(uuid)?
|
|
| path == "/" && query.firstname -> Customer?:
|
|
service.get_by_firstname(fname)?
|
|
| path == "/" && query.last_name -> Customer?
|
|
service.get_by_lastname(lname)?
|
|
| 404
|
|
|
|
fn post(customer: Customer):
|
|
service.add(customer)
|
|
|
|
|
|
fn put(customer: Customer):
|
|
service.update(customer)
|