diff --git a/apps/web/modules/analysis/components/SingleResponseCard/components/ResponseTagsWrapper.tsx b/apps/web/modules/analysis/components/SingleResponseCard/components/ResponseTagsWrapper.tsx index 409c8d10bc..408916bb48 100644 --- a/apps/web/modules/analysis/components/SingleResponseCard/components/ResponseTagsWrapper.tsx +++ b/apps/web/modules/analysis/components/SingleResponseCard/components/ResponseTagsWrapper.tsx @@ -93,7 +93,10 @@ export const ResponseTagsWrapper: React.FC = ({ return; } - if (createTagResponse?.data?.error?.code === TagError.TAG_NAME_ALREADY_EXISTS) { + if ( + createTagResponse?.data?.ok === false && + createTagResponse?.data?.error?.code === TagError.TAG_NAME_ALREADY_EXISTS + ) { toast.error(t("environments.surveys.responses.tag_already_exists"), { duration: 2000, icon: , diff --git a/apps/web/modules/ee/audit-logs/lib/handler.ts b/apps/web/modules/ee/audit-logs/lib/handler.ts index 4d99e29653..54bc6ab928 100644 --- a/apps/web/modules/ee/audit-logs/lib/handler.ts +++ b/apps/web/modules/ee/audit-logs/lib/handler.ts @@ -199,21 +199,21 @@ export const queueAuditEvent = async ({ * @param targetType - The type of target (e.g., "segment", "survey"). * @param handler - The handler function to wrap. It can be used with both authenticated and unauthenticated actions. **/ -export const withAuditLogging = >( +export const withAuditLogging = , TResult = unknown>( action: TAuditAction, targetType: TAuditTarget, handler: (args: { ctx: ActionClientCtx | AuthenticatedActionClientCtx; parsedInput: TParsedInput; - }) => Promise + }) => Promise ) => { return async function wrappedAction(args: { ctx: ActionClientCtx | AuthenticatedActionClientCtx; parsedInput: TParsedInput; - }) { + }): Promise { const { ctx, parsedInput } = args; const { auditLoggingCtx } = ctx; - let result: any; + let result!: TResult; let status: TAuditStatus = "success"; let error: any = undefined;