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 { createEventManagementApi } from '../api';
|
||||
|
||||
export const createEvent = authActionClient
|
||||
.inputSchema(CreateEventSchema)
|
||||
.action(async ({ parsedInput: input, ctx: _ctx }) => {
|
||||
.action(async ({ parsedInput: input, ctx }) => {
|
||||
const client = getSupabaseServerClient();
|
||||
const logger = await getLogger();
|
||||
const api = createEventManagementApi(client);
|
||||
@@ -29,7 +29,7 @@ export const createEvent = authActionClient
|
||||
|
||||
export const updateEvent = authActionClient
|
||||
.inputSchema(UpdateEventSchema)
|
||||
.action(async ({ parsedInput: input, ctx: _ctx }) => {
|
||||
.action(async ({ parsedInput: input, ctx }) => {
|
||||
const client = getSupabaseServerClient();
|
||||
const logger = await getLogger();
|
||||
const api = createEventManagementApi(client);
|
||||
@@ -42,7 +42,7 @@ export const updateEvent = authActionClient
|
||||
|
||||
export const deleteEvent = authActionClient
|
||||
.inputSchema(z.object({ eventId: z.string().uuid() }))
|
||||
.action(async ({ parsedInput: input, ctx: _ctx }) => {
|
||||
.action(async ({ parsedInput: input, ctx }) => {
|
||||
const client = getSupabaseServerClient();
|
||||
const logger = await getLogger();
|
||||
const api = createEventManagementApi(client);
|
||||
@@ -55,7 +55,7 @@ export const deleteEvent = authActionClient
|
||||
|
||||
export const registerForEvent = authActionClient
|
||||
.inputSchema(EventRegistrationSchema)
|
||||
.action(async ({ parsedInput: input, ctx: _ctx }) => {
|
||||
.action(async ({ parsedInput: input, ctx }) => {
|
||||
const client = getSupabaseServerClient();
|
||||
const logger = await getLogger();
|
||||
const api = createEventManagementApi(client);
|
||||
@@ -68,7 +68,7 @@ export const registerForEvent = authActionClient
|
||||
|
||||
export const createHolidayPass = authActionClient
|
||||
.inputSchema(CreateHolidayPassSchema)
|
||||
.action(async ({ parsedInput: input, ctx: _ctx }) => {
|
||||
.action(async ({ parsedInput: input, ctx }) => {
|
||||
const client = getSupabaseServerClient();
|
||||
const logger = await getLogger();
|
||||
const api = createEventManagementApi(client);
|
||||
|
||||
Reference in New Issue
Block a user