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:
@@ -26,7 +26,7 @@ const REVALIDATION_PATH = '/home/[account]/meetings';
|
||||
|
||||
export const createProtocol = authActionClient
|
||||
.inputSchema(CreateMeetingProtocolSchema)
|
||||
.action(async ({ parsedInput: input, ctx: _ctx }) => {
|
||||
.action(async ({ parsedInput: input, ctx }) => {
|
||||
const client = getSupabaseServerClient();
|
||||
const logger = await getLogger();
|
||||
const api = createMeetingsApi(client);
|
||||
@@ -44,7 +44,7 @@ export const createProtocol = authActionClient
|
||||
|
||||
export const updateProtocol = authActionClient
|
||||
.inputSchema(UpdateMeetingProtocolSchema)
|
||||
.action(async ({ parsedInput: input, ctx: _ctx }) => {
|
||||
.action(async ({ parsedInput: input, ctx }) => {
|
||||
const client = getSupabaseServerClient();
|
||||
const logger = await getLogger();
|
||||
const api = createMeetingsApi(client);
|
||||
@@ -88,7 +88,7 @@ export const deleteProtocol = authActionClient
|
||||
|
||||
export const createProtocolItem = authActionClient
|
||||
.inputSchema(CreateProtocolItemSchema)
|
||||
.action(async ({ parsedInput: input, ctx: _ctx }) => {
|
||||
.action(async ({ parsedInput: input, ctx }) => {
|
||||
const client = getSupabaseServerClient();
|
||||
const logger = await getLogger();
|
||||
const api = createMeetingsApi(client);
|
||||
@@ -109,7 +109,7 @@ export const createProtocolItem = authActionClient
|
||||
|
||||
export const updateProtocolItem = authActionClient
|
||||
.inputSchema(UpdateProtocolItemSchema)
|
||||
.action(async ({ parsedInput: input, ctx: _ctx }) => {
|
||||
.action(async ({ parsedInput: input, ctx }) => {
|
||||
const client = getSupabaseServerClient();
|
||||
const logger = await getLogger();
|
||||
const api = createMeetingsApi(client);
|
||||
@@ -130,7 +130,7 @@ export const updateProtocolItem = authActionClient
|
||||
|
||||
export const updateItemStatus = authActionClient
|
||||
.inputSchema(UpdateItemStatusSchema)
|
||||
.action(async ({ parsedInput: input, ctx: _ctx }) => {
|
||||
.action(async ({ parsedInput: input, ctx }) => {
|
||||
const client = getSupabaseServerClient();
|
||||
const logger = await getLogger();
|
||||
const api = createMeetingsApi(client);
|
||||
@@ -198,7 +198,7 @@ export const addProtocolAttachment = authActionClient
|
||||
mimeType: z.string().min(1),
|
||||
}),
|
||||
)
|
||||
.action(async ({ parsedInput: input, ctx: _ctx }) => {
|
||||
.action(async ({ parsedInput: input, ctx }) => {
|
||||
const client = getSupabaseServerClient();
|
||||
const logger = await getLogger();
|
||||
const api = createMeetingsApi(client);
|
||||
|
||||
Reference in New Issue
Block a user