feat: event proposal and approval workflow #9
2 changed files with 3 additions and 1 deletions
fix: make wallet optional in CreateEvent for propose endpoint
Some checks failed
lint.yml / fix: make wallet optional in CreateEvent for propose endpoint (pull_request) Failing after 0s
Some checks failed
lint.yml / fix: make wallet optional in CreateEvent for propose endpoint (pull_request) Failing after 0s
The propose endpoint sets wallet from the authenticated user's invoice key. Making wallet optional in the model allows the request body to omit it. The admin create endpoint falls back to the auth wallet if not provided. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
commit
32ea79a137
|
|
@ -28,7 +28,7 @@ class EventExtra(BaseModel):
|
|||
|
||||
|
||||
class CreateEvent(BaseModel):
|
||||
wallet: str
|
||||
wallet: Optional[str] = None
|
||||
name: str
|
||||
info: str
|
||||
closing_date: str
|
||||
|
|
|
|||
|
|
@ -85,6 +85,8 @@ async def api_event_create(
|
|||
setattr(event, k, v)
|
||||
event = await update_event(event)
|
||||
else:
|
||||
if not data.wallet:
|
||||
data.wallet = wallet.wallet.id
|
||||
event = await create_event(data)
|
||||
|
||||
return event.dict()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue