Skip to content

Commit 34dd3e8

Browse files
authored
Merge pull request #16 from Paca-AI/fix/jsonbody-tinygo-collision
Fix TinyGo JSONBody[T] type-name collision
2 parents 853f89c + 3e3fece commit 34dd3e8

3 files changed

Lines changed: 9 additions & 9 deletions

File tree

backend/checklists.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,10 +126,10 @@ func (p *checklistPlugin) createChecklist(req *plugin.Request, res *plugin.Respo
126126
return
127127
}
128128

129-
type body struct {
129+
type createChecklistBody struct {
130130
Title string `json:"title"`
131131
}
132-
b, err := plugin.JSONBody[body](req)
132+
b, err := plugin.JSONBody[createChecklistBody](req)
133133
if err != nil || b.Title == "" {
134134
res.Error(400, "title is required")
135135
return
@@ -189,10 +189,10 @@ func (p *checklistPlugin) updateChecklist(req *plugin.Request, res *plugin.Respo
189189
return
190190
}
191191

192-
type body struct {
192+
type updateChecklistBody struct {
193193
Title *string `json:"title"`
194194
}
195-
b, err := plugin.JSONBody[body](req)
195+
b, err := plugin.JSONBody[updateChecklistBody](req)
196196
if err != nil {
197197
res.Error(400, "invalid request body")
198198
return

backend/items.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,10 @@ func (p *checklistPlugin) createItem(req *plugin.Request, res *plugin.Response)
5050
return
5151
}
5252

53-
type body struct {
53+
type createItemBody struct {
5454
Title string `json:"title"`
5555
}
56-
b, err := plugin.JSONBody[body](req)
56+
b, err := plugin.JSONBody[createItemBody](req)
5757
if err != nil || b.Title == "" {
5858
res.Error(400, "title is required")
5959
return
@@ -117,12 +117,12 @@ func (p *checklistPlugin) updateItem(req *plugin.Request, res *plugin.Response)
117117
return
118118
}
119119

120-
type body struct {
120+
type updateItemBody struct {
121121
Title *string `json:"title"`
122122
IsChecked *bool `json:"is_checked"`
123123
AssigneeID optionalString `json:"assignee_id"`
124124
}
125-
b, err := plugin.JSONBody[body](req)
125+
b, err := plugin.JSONBody[updateItemBody](req)
126126
if err != nil {
127127
res.Error(400, "invalid request body")
128128
return

plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"id": "com.paca.checklist",
33
"displayName": "Checklist",
44
"description": "Adds named checklists with checkable items to tasks.",
5-
"version": "0.2.10",
5+
"version": "0.2.11",
66
"minCoreVersion": "v0.13.3",
77
"permissions": ["db.read", "db.write", "events.subscribe"],
88
"backend": {

0 commit comments

Comments
 (0)