fix: revert ctx→_ctx rename — ctx IS used for auth in server actions
The previous lint fix incorrectly renamed ctx to _ctx in server actions that actually USE ctx.user.id for authorization. This caused runtime 'ctx is not defined' errors when creating pages, modules, etc. Reverted all 13 action files back to using ctx properly.
This commit is contained in:
@@ -16,7 +16,7 @@ import { createSiteBuilderApi } from '../api';
|
||||
|
||||
export const createPage = authActionClient
|
||||
.inputSchema(CreatePageSchema)
|
||||
.action(async ({ parsedInput: input, ctx: _ctx }) => {
|
||||
.action(async ({ parsedInput: input, ctx }) => {
|
||||
const client = getSupabaseServerClient();
|
||||
const api = createSiteBuilderApi(client);
|
||||
const data = await api.createPage(input, ctx.user.id);
|
||||
@@ -25,7 +25,7 @@ export const createPage = authActionClient
|
||||
|
||||
export const saveDraft = authActionClient
|
||||
.inputSchema(UpdatePageSchema)
|
||||
.action(async ({ parsedInput: input, ctx: _ctx }) => {
|
||||
.action(async ({ parsedInput: input, ctx }) => {
|
||||
const client = getSupabaseServerClient();
|
||||
const api = createSiteBuilderApi(client);
|
||||
const data = await api.updatePage(
|
||||
@@ -38,7 +38,7 @@ export const saveDraft = authActionClient
|
||||
|
||||
export const publishPage = authActionClient
|
||||
.inputSchema(UpdatePageSchema)
|
||||
.action(async ({ parsedInput: input, ctx: _ctx }) => {
|
||||
.action(async ({ parsedInput: input, ctx }) => {
|
||||
const client = getSupabaseServerClient();
|
||||
const api = createSiteBuilderApi(client);
|
||||
const data = await api.updatePage(
|
||||
@@ -69,7 +69,7 @@ export const updateSiteSettings = authActionClient
|
||||
|
||||
export const createPost = authActionClient
|
||||
.inputSchema(CreatePostSchema)
|
||||
.action(async ({ parsedInput: input, ctx: _ctx }) => {
|
||||
.action(async ({ parsedInput: input, ctx }) => {
|
||||
const client = getSupabaseServerClient();
|
||||
const api = createSiteBuilderApi(client);
|
||||
const data = await api.createPost(input, ctx.user.id);
|
||||
|
||||
Reference in New Issue
Block a user