update, remove the has_attachment field from the envelopes table.

This commit is contained in:
rustmailer
2026-03-26 21:53:19 +08:00
parent 3f11c5dbbf
commit 0914bf710e
9 changed files with 27 additions and 20 deletions
+4 -4
View File
@@ -21,7 +21,7 @@ import { HTMLAttributes, useState } from 'react'
import { z } from 'zod'
import { useForm } from 'react-hook-form'
import { zodResolver } from '@hookform/resolvers/zod'
import { cn } from '@/lib/utils'
import { cn, toSearchParams } from '@/lib/utils'
import {
Form,
FormControl,
@@ -65,7 +65,7 @@ export function UserAuthForm({ className, ...props }: UserAuthFormProps) {
const { t } = useTranslation()
const { search } = useLocation();
const redirect = new URLSearchParams(search).get('redirect') || '/';
const redirect = toSearchParams(search).get('redirect') || '/';
const formSchema = getFormSchema(t)
const form = useForm<z.infer<typeof formSchema>>({
@@ -92,11 +92,11 @@ export function UserAuthForm({ className, ...props }: UserAuthFormProps) {
if (result.theme) {
setTheme(result.theme);
}
if (result.language) {
i18n.changeLanguage(result.language);
}
navigate({ to: redirect });
} else {
toast({
+2 -1
View File
@@ -23,11 +23,12 @@ import { useLocation } from "@tanstack/react-router";
import { AlertCircle, CheckCircle2, Info } from "lucide-react";
import { Button } from "@/components/ui/button";
import { useTranslation } from "react-i18next";
import { toSearchParams } from "@/lib/utils";
export default function OAuth2Result() {
const { t } = useTranslation();
const { search } = useLocation();
const params = new URLSearchParams(search);
const params = toSearchParams(search);
const error = params.get("error");
const message = params.get("message");
const success = params.get("success");
@@ -25,13 +25,10 @@ import {
ShieldCheck,
Server,
Database,
Globe,
Lock,
Activity,
InfoIcon,
Mail,
Zap,
Cpu
Zap
} from "lucide-react"
import { get_system_configurations } from "@/api/system/api"
import { useQuery } from "@tanstack/react-query"
+11
View File
@@ -187,4 +187,15 @@ export function showNumbers(current: number, total: number) {
}
}
return result
}
export function toSearchParams(obj: Record<string, any>): URLSearchParams {
const params = new URLSearchParams();
Object.entries(obj).forEach(([key, value]) => {
if (value !== undefined && value !== null) {
params.append(key, String(value));
}
});
return params;
}