Skip to content

Commit 6d71f96

Browse files
committed
fix: bind serialize method as an instance property
1 parent 5701f47 commit 6d71f96

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

api/apps/backend/providers/api_provider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,6 @@ const serializer = new ApiSerializer()
5353
* Usage in controllers: return ctx.serialize(data)
5454
* This ensures all API responses follow the same structure with data wrapping.
5555
*/
56-
HttpContext.macro('serialize', function (this: HttpContext, values: any): any {
56+
HttpContext.instanceProperty('serialize', function (this: HttpContext, values: any): any {
5757
return serializer.serialize(values, this.containerResolver)
5858
})

inertia-react/providers/api_provider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,6 @@ const serializer = new ApiSerializer()
5353
* Usage in controllers: return ctx.serialize(data)
5454
* This ensures all API responses follow the same structure with data wrapping.
5555
*/
56-
HttpContext.macro('serialize', function (this: HttpContext, values: any): any {
56+
HttpContext.instanceProperty('serialize', function (this: HttpContext, values: any): any {
5757
return serializer.serialize(values, this.containerResolver)
5858
})

inertia-vue/providers/api_provider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,6 @@ const serializer = new ApiSerializer()
5353
* Usage in controllers: return ctx.serialize(data)
5454
* This ensures all API responses follow the same structure with data wrapping.
5555
*/
56-
HttpContext.macro('serialize', function (this: HttpContext, values: any): any {
56+
HttpContext.instanceProperty('serialize', function (this: HttpContext, values: any): any {
5757
return serializer.serialize(values, this.containerResolver)
5858
})

0 commit comments

Comments
 (0)