Refactor duplicate handling to allow any authenticated user to check for duplicates, update API methods to require general authentication, and enhance expense fetching with improved error handling and logging.
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
import { requireAdmin } from '~/server/utils/auth';
|
||||
import { requireAuth } from '~/server/utils/auth';
|
||||
import { getNocoDbConfiguration } from '~/server/utils/nocodb';
|
||||
|
||||
export default defineEventHandler(async (event) => {
|
||||
console.log('[ADMIN] Find duplicates request');
|
||||
console.log('[DUPLICATES] Find duplicates request');
|
||||
|
||||
try {
|
||||
// Require admin authentication
|
||||
await requireAdmin(event);
|
||||
// Require authentication (any authenticated user with interest access)
|
||||
await requireAuth(event);
|
||||
|
||||
const query = getQuery(event);
|
||||
const threshold = query.threshold ? parseFloat(query.threshold as string) : 0.8;
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import { requireAdmin } from '~/server/utils/auth';
|
||||
import { requireAuth } from '~/server/utils/auth';
|
||||
import { getNocoDbConfiguration, updateInterest, deleteInterest } from '~/server/utils/nocodb';
|
||||
|
||||
export default defineEventHandler(async (event) => {
|
||||
console.log('[ADMIN] Merge duplicates request');
|
||||
|
||||
try {
|
||||
// Require admin authentication
|
||||
await requireAdmin(event);
|
||||
// Require authentication (any authenticated user with interest access)
|
||||
await requireAuth(event);
|
||||
|
||||
const body = await readBody(event);
|
||||
const { masterId, duplicateIds, mergeData } = body;
|
||||
|
||||
Reference in New Issue
Block a user