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:
@@ -39,7 +39,7 @@ import { createFischereiApi } from '../api';
|
||||
|
||||
export const createWater = authActionClient
|
||||
.inputSchema(CreateWaterSchema)
|
||||
.action(async ({ parsedInput: input, ctx: _ctx }) => {
|
||||
.action(async ({ parsedInput: input, ctx }) => {
|
||||
const client = getSupabaseServerClient();
|
||||
const logger = await getLogger();
|
||||
const api = createFischereiApi(client);
|
||||
@@ -54,7 +54,7 @@ export const createWater = authActionClient
|
||||
|
||||
export const updateWater = authActionClient
|
||||
.inputSchema(UpdateWaterSchema)
|
||||
.action(async ({ parsedInput: input, ctx: _ctx }) => {
|
||||
.action(async ({ parsedInput: input, ctx }) => {
|
||||
const client = getSupabaseServerClient();
|
||||
const logger = await getLogger();
|
||||
const api = createFischereiApi(client);
|
||||
@@ -191,7 +191,7 @@ export const deleteWaterSpeciesRule = authActionClient
|
||||
|
||||
export const createStocking = authActionClient
|
||||
.inputSchema(CreateStockingSchema)
|
||||
.action(async ({ parsedInput: input, ctx: _ctx }) => {
|
||||
.action(async ({ parsedInput: input, ctx }) => {
|
||||
const client = getSupabaseServerClient();
|
||||
const logger = await getLogger();
|
||||
const api = createFischereiApi(client);
|
||||
@@ -212,7 +212,7 @@ export const createStocking = authActionClient
|
||||
|
||||
export const updateStocking = authActionClient
|
||||
.inputSchema(UpdateStockingSchema)
|
||||
.action(async ({ parsedInput: input, ctx: _ctx }) => {
|
||||
.action(async ({ parsedInput: input, ctx }) => {
|
||||
const client = getSupabaseServerClient();
|
||||
const logger = await getLogger();
|
||||
const api = createFischereiApi(client);
|
||||
@@ -262,7 +262,7 @@ export const deleteStocking = authActionClient
|
||||
|
||||
export const createLease = authActionClient
|
||||
.inputSchema(CreateLeaseSchema)
|
||||
.action(async ({ parsedInput: input, ctx: _ctx }) => {
|
||||
.action(async ({ parsedInput: input, ctx }) => {
|
||||
const client = getSupabaseServerClient();
|
||||
const logger = await getLogger();
|
||||
const api = createFischereiApi(client);
|
||||
@@ -277,7 +277,7 @@ export const createLease = authActionClient
|
||||
|
||||
export const updateLease = authActionClient
|
||||
.inputSchema(UpdateLeaseSchema)
|
||||
.action(async ({ parsedInput: input, ctx: _ctx }) => {
|
||||
.action(async ({ parsedInput: input, ctx }) => {
|
||||
const client = getSupabaseServerClient();
|
||||
const logger = await getLogger();
|
||||
const api = createFischereiApi(client);
|
||||
@@ -315,7 +315,7 @@ export const deleteLease = authActionClient
|
||||
|
||||
export const createCatchBook = authActionClient
|
||||
.inputSchema(CreateCatchBookSchema)
|
||||
.action(async ({ parsedInput: input, ctx: _ctx }) => {
|
||||
.action(async ({ parsedInput: input, ctx }) => {
|
||||
const client = getSupabaseServerClient();
|
||||
const logger = await getLogger();
|
||||
const api = createFischereiApi(client);
|
||||
@@ -333,7 +333,7 @@ export const createCatchBook = authActionClient
|
||||
|
||||
export const updateCatchBook = authActionClient
|
||||
.inputSchema(UpdateCatchBookSchema)
|
||||
.action(async ({ parsedInput: input, ctx: _ctx }) => {
|
||||
.action(async ({ parsedInput: input, ctx }) => {
|
||||
const client = getSupabaseServerClient();
|
||||
const logger = await getLogger();
|
||||
const api = createFischereiApi(client);
|
||||
@@ -356,7 +356,7 @@ export const submitCatchBook = authActionClient
|
||||
accountId: z.string().uuid(),
|
||||
}),
|
||||
)
|
||||
.action(async ({ parsedInput: input, ctx: _ctx }) => {
|
||||
.action(async ({ parsedInput: input, ctx }) => {
|
||||
const client = getSupabaseServerClient();
|
||||
const logger = await getLogger();
|
||||
const api = createFischereiApi(client);
|
||||
@@ -382,7 +382,7 @@ export const reviewCatchBook = authActionClient
|
||||
remarks: z.string().optional(),
|
||||
}),
|
||||
)
|
||||
.action(async ({ parsedInput: input, ctx: _ctx }) => {
|
||||
.action(async ({ parsedInput: input, ctx }) => {
|
||||
const client = getSupabaseServerClient();
|
||||
const logger = await getLogger();
|
||||
const api = createFischereiApi(client);
|
||||
@@ -580,7 +580,7 @@ export const removeInspector = authActionClient
|
||||
|
||||
export const createCompetition = authActionClient
|
||||
.inputSchema(CreateCompetitionSchema)
|
||||
.action(async ({ parsedInput: input, ctx: _ctx }) => {
|
||||
.action(async ({ parsedInput: input, ctx }) => {
|
||||
const client = getSupabaseServerClient();
|
||||
const logger = await getLogger();
|
||||
const api = createFischereiApi(client);
|
||||
@@ -601,7 +601,7 @@ export const createCompetition = authActionClient
|
||||
|
||||
export const updateCompetition = authActionClient
|
||||
.inputSchema(UpdateCompetitionSchema)
|
||||
.action(async ({ parsedInput: input, ctx: _ctx }) => {
|
||||
.action(async ({ parsedInput: input, ctx }) => {
|
||||
const client = getSupabaseServerClient();
|
||||
const logger = await getLogger();
|
||||
const api = createFischereiApi(client);
|
||||
|
||||
Reference in New Issue
Block a user