Skip to content

Commit

Permalink
add metadata property as a middleware
Browse files Browse the repository at this point in the history
  • Loading branch information
kainpets committed Oct 11, 2023
1 parent 744fa8e commit 979f9be
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
4 changes: 1 addition & 3 deletions packages/nextlove/src/with-route-spec/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,7 @@ export const createWithRouteSpec: CreateWithRouteSpecFunction = ((
shouldValidateGetRequestBody,
supportedArrayFormats,
}),
withMetadata({
legacySdkTakesDeviceIdStringParameter: true,
}),
withMetadata(spec.metaData),
userDefinedRouteFn
)(req as any, res)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const MetaDataSchema = z.object({
export type MetaData = z.infer<typeof MetaDataSchema>

export const withMetadata = (metaData: MetaData) => (next) => (req, res) => {
// do something with metaData
return next(req, res)
}

Expand Down

0 comments on commit 979f9be

Please sign in to comment.