From 860ebdae15000638b2fdf200a5d35593e84fcb65 Mon Sep 17 00:00:00 2001 From: Scott Yeager Date: Wed, 24 Sep 2025 12:26:40 -0700 Subject: [PATCH] Revert set method decoding into args struct --- lib/hero/heromodels/calendar.v | 3 +-- lib/hero/heromodels/calendar_event.v | 3 +-- lib/hero/heromodels/chat_group.v | 3 +-- lib/hero/heromodels/chat_message.v | 3 +-- lib/hero/heromodels/contact.v | 3 +-- lib/hero/heromodels/group.v | 3 +-- lib/hero/heromodels/message.v | 3 +-- lib/hero/heromodels/planning.v | 3 +-- lib/hero/heromodels/project_issue.v | 3 +-- lib/hero/heromodels/registration_desk.v | 3 +-- lib/hero/heromodels/user.v | 3 +-- 11 files changed, 11 insertions(+), 22 deletions(-) diff --git a/lib/hero/heromodels/calendar.v b/lib/hero/heromodels/calendar.v index fa428f91..98706212 100644 --- a/lib/hero/heromodels/calendar.v +++ b/lib/hero/heromodels/calendar.v @@ -150,8 +150,7 @@ pub fn calendar_handle(mut f ModelsFactory, rpcid int, servercontext map[string] return new_response(rpcid, json.encode(res)) } 'set' { - args := db.decode_generic[CalendarArg](params)! - mut o := f.calendar.new(args)! + mut o := db.decode_generic[Calendar](params)! o = f.calendar.set(o)! return new_response_int(rpcid, int(o.id)) } diff --git a/lib/hero/heromodels/calendar_event.v b/lib/hero/heromodels/calendar_event.v index 2017bba7..1ac1e6a9 100644 --- a/lib/hero/heromodels/calendar_event.v +++ b/lib/hero/heromodels/calendar_event.v @@ -457,8 +457,7 @@ pub fn calendar_event_handle(mut f ModelsFactory, rpcid int, servercontext map[s return new_response(rpcid, json.encode_pretty(res)) } 'set' { - args := db.decode_generic[CalendarEventArg](params)! - mut o := f.calendar_event.new(args)! + mut o := db.decode_generic[CalendarEvent](params)! o = f.calendar_event.set(o)! return new_response_int(rpcid, int(o.id)) } diff --git a/lib/hero/heromodels/chat_group.v b/lib/hero/heromodels/chat_group.v index a87e14d4..141d58c8 100644 --- a/lib/hero/heromodels/chat_group.v +++ b/lib/hero/heromodels/chat_group.v @@ -170,8 +170,7 @@ pub fn chat_group_handle(mut f ModelsFactory, rpcid int, servercontext map[strin return new_response(rpcid, json.encode(res)) } 'set' { - args := db.decode_generic[ChatGroupArg](params)! - mut o := f.chat_group.new(args)! + mut o := db.decode_generic[ChatGroup](params)! o = f.chat_group.set(o)! return new_response_int(rpcid, int(o.id)) } diff --git a/lib/hero/heromodels/chat_message.v b/lib/hero/heromodels/chat_message.v index 3a742275..c85d9604 100644 --- a/lib/hero/heromodels/chat_message.v +++ b/lib/hero/heromodels/chat_message.v @@ -270,8 +270,7 @@ pub fn chat_message_handle(mut f ModelsFactory, rpcid int, servercontext map[str return new_response(rpcid, json.encode(res)) } 'set' { - args := db.decode_generic[ChatMessageArg](params)! - mut o := f.chat_message.new(args)! + mut o := db.decode_generic[ChatMessage](params)! o = f.chat_message.set(o)! return new_response_int(rpcid, int(o.id)) } diff --git a/lib/hero/heromodels/contact.v b/lib/hero/heromodels/contact.v index c7f9eb3e..bbfcf0d0 100644 --- a/lib/hero/heromodels/contact.v +++ b/lib/hero/heromodels/contact.v @@ -203,8 +203,7 @@ pub fn contact_handle(mut f ModelsFactory, rpcid int, servercontext map[string]s return new_response(rpcid, json.encode(res)) } 'set' { - args := db.decode_generic[ContactArg](params)! - mut o := f.contact.new(args)! + mut o := db.decode_generic[Contact](params)! o = f.contact.set(o)! return new_response_int(rpcid, int(o.id)) } diff --git a/lib/hero/heromodels/group.v b/lib/hero/heromodels/group.v index b366926f..8e2fb88a 100644 --- a/lib/hero/heromodels/group.v +++ b/lib/hero/heromodels/group.v @@ -258,8 +258,7 @@ pub fn group_handle(mut f ModelsFactory, rpcid int, servercontext map[string]str return new_response(rpcid, json.encode(res)) } 'set' { - args := db.decode_generic[GroupArg](params)! - mut o := f.group.new(args)! + mut o := db.decode_generic[Group](params)! o = f.group.set(o)! return new_response_int(rpcid, int(o.id)) } diff --git a/lib/hero/heromodels/message.v b/lib/hero/heromodels/message.v index 06b341a5..ca9610dc 100644 --- a/lib/hero/heromodels/message.v +++ b/lib/hero/heromodels/message.v @@ -232,8 +232,7 @@ pub fn message_handle(mut f ModelsFactory, rpcid int, servercontext map[string]s return new_response(rpcid, json.encode(res)) } 'set' { - args := db.decode_generic[MessageArg](params)! - mut o := f.messages.new(args)! + mut o := db.decode_generic[Message](params)! o = f.messages.set(o)! return new_response_int(rpcid, int(o.id)) } diff --git a/lib/hero/heromodels/planning.v b/lib/hero/heromodels/planning.v index 6652818b..66118ece 100644 --- a/lib/hero/heromodels/planning.v +++ b/lib/hero/heromodels/planning.v @@ -292,8 +292,7 @@ pub fn planning_handle(mut f ModelsFactory, rpcid int, servercontext map[string] return new_response(rpcid, json.encode(res)) } 'set' { - args := db.decode_generic[PlanningArg](params)! - mut o := f.planning.new(args)! + mut o := db.decode_generic[Planning](params)! o = f.planning.set(o)! return new_response_int(rpcid, int(o.id)) } diff --git a/lib/hero/heromodels/project_issue.v b/lib/hero/heromodels/project_issue.v index f9b00791..100ffb8c 100644 --- a/lib/hero/heromodels/project_issue.v +++ b/lib/hero/heromodels/project_issue.v @@ -324,8 +324,7 @@ pub fn project_issue_handle(mut f ModelsFactory, rpcid int, servercontext map[st return new_response(rpcid, json.encode(res)) } 'set' { - args := db.decode_generic[ProjectIssueArg](params)! - mut o := f.project_issue.new(args)! + mut o := db.decode_generic[ProjectIssue](params)! o = f.project_issue.set(o)! return new_response_int(rpcid, int(o.id)) } diff --git a/lib/hero/heromodels/registration_desk.v b/lib/hero/heromodels/registration_desk.v index 5a371447..22d44145 100644 --- a/lib/hero/heromodels/registration_desk.v +++ b/lib/hero/heromodels/registration_desk.v @@ -298,8 +298,7 @@ pub fn registration_desk_handle(mut f ModelsFactory, rpcid int, servercontext ma return new_response(rpcid, json.encode(res)) } 'set' { - args := db.decode_generic[RegistrationDeskArg](params)! - mut o := f.registration_desk.new(args)! + mut o := db.decode_generic[RegistrationDesk](params)! o = f.registration_desk.set(o)! return new_response_int(rpcid, int(o.id)) } diff --git a/lib/hero/heromodels/user.v b/lib/hero/heromodels/user.v index 9af353d1..9aab7db3 100644 --- a/lib/hero/heromodels/user.v +++ b/lib/hero/heromodels/user.v @@ -186,8 +186,7 @@ pub fn user_handle(mut f ModelsFactory, rpcid int, servercontext map[string]stri return new_response(rpcid, json.encode(res)) } 'set' { - args := db.decode_generic[UserArg](params)! - mut o := f.user.new(args)! + mut o := db.decode_generic[User](params)! o = f.user.set(o)! return new_response_int(rpcid, int(o.id)) }