Skip to content

Commit

Permalink
Update plugin template to new response() semantics
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanblock committed Oct 5, 2023
1 parent 3b70d28 commit 43f2de5
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions scripts/generate-plugins/_plugin-tmpl.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,7 @@ export default {
endpoint: `/$API_VER/${name}/etc`
}
},
response: async (raw) => {
let response = raw.Item || null
return { response }
},
response: async ({ payload }) => payload,
error: async (err) => {
if (err.statusCode === 400 &&
err?.error?.message?.match(/validation error/)) {
Expand All @@ -42,7 +39,7 @@ export default {
endpoint: `/$API_VER/${name}/etc`
}
},
// response: async (response) => ({ response }),
// response: async ({ payload }) => payload,
// error: async (err) => err,
},
}
Expand Down

0 comments on commit 43f2de5

Please sign in to comment.