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:
@@ -14,7 +14,7 @@ import { createNewsletterApi } from '../api';
|
||||
|
||||
export const createNewsletter = authActionClient
|
||||
.inputSchema(CreateNewsletterSchema)
|
||||
.action(async ({ parsedInput: input, ctx: _ctx }) => {
|
||||
.action(async ({ parsedInput: input, ctx }) => {
|
||||
const client = getSupabaseServerClient();
|
||||
const logger = await getLogger();
|
||||
const api = createNewsletterApi(client);
|
||||
@@ -28,7 +28,7 @@ export const createNewsletter = authActionClient
|
||||
|
||||
export const updateNewsletter = authActionClient
|
||||
.inputSchema(UpdateNewsletterSchema)
|
||||
.action(async ({ parsedInput: input, ctx: _ctx }) => {
|
||||
.action(async ({ parsedInput: input, ctx }) => {
|
||||
const client = getSupabaseServerClient();
|
||||
const logger = await getLogger();
|
||||
const api = createNewsletterApi(client);
|
||||
@@ -50,7 +50,7 @@ export const createTemplate = authActionClient
|
||||
variables: z.array(z.string()).optional(),
|
||||
}),
|
||||
)
|
||||
.action(async ({ parsedInput: input, ctx: _ctx }) => {
|
||||
.action(async ({ parsedInput: input, ctx }) => {
|
||||
const client = getSupabaseServerClient();
|
||||
const logger = await getLogger();
|
||||
const api = createNewsletterApi(client);
|
||||
@@ -73,7 +73,7 @@ export const addRecipients = authActionClient
|
||||
.optional(),
|
||||
}),
|
||||
)
|
||||
.action(async ({ parsedInput: input, ctx: _ctx }) => {
|
||||
.action(async ({ parsedInput: input, ctx }) => {
|
||||
const client = getSupabaseServerClient();
|
||||
const logger = await getLogger();
|
||||
const api = createNewsletterApi(client);
|
||||
@@ -94,7 +94,7 @@ export const dispatchNewsletter = authActionClient
|
||||
newsletterId: z.string().uuid(),
|
||||
}),
|
||||
)
|
||||
.action(async ({ parsedInput: input, ctx: _ctx }) => {
|
||||
.action(async ({ parsedInput: input, ctx }) => {
|
||||
const client = getSupabaseServerClient();
|
||||
const logger = await getLogger();
|
||||
const api = createNewsletterApi(client);
|
||||
|
||||
Reference in New Issue
Block a user