Compare commits
2 Commits
4c7783884c
...
7519f474f3
| Author | SHA1 | Date | |
|---|---|---|---|
| 7519f474f3 | |||
| 35494d8b32 |
@@ -25,7 +25,9 @@ public class DemoSeedController : CafeApiControllerBase
|
|||||||
CancellationToken ct)
|
CancellationToken ct)
|
||||||
{
|
{
|
||||||
if (EnsureCafeAccess(cafeId, tenant) is { } denied) return denied;
|
if (EnsureCafeAccess(cafeId, tenant) is { } denied) return denied;
|
||||||
if (EnsureOwner(tenant) is { } ownerDenied) return ownerDenied;
|
// Demo data is a setup helper; Owner or Manager may run it (matches the
|
||||||
|
// dashboard banner, which is shown to both roles).
|
||||||
|
if (EnsureManager(tenant) is { } managerDenied) return managerDenied;
|
||||||
|
|
||||||
var result = await _demoSeed.SeedAsync(cafeId, ct);
|
var result = await _demoSeed.SeedAsync(cafeId, ct);
|
||||||
return Ok(new ApiResponse<DemoSeedResult>(true, result));
|
return Ok(new ApiResponse<DemoSeedResult>(true, result));
|
||||||
|
|||||||
@@ -3,7 +3,8 @@
|
|||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { useMutation, useQueryClient } from "@tanstack/react-query";
|
import { useMutation, useQueryClient } from "@tanstack/react-query";
|
||||||
import { Sparkles, Loader2 } from "lucide-react";
|
import { Sparkles, Loader2 } from "lucide-react";
|
||||||
import { apiPost } from "@/lib/api/client";
|
import { ApiClientError, apiPost } from "@/lib/api/client";
|
||||||
|
import { notify } from "@/lib/notify";
|
||||||
import { useAuthStore } from "@/lib/stores/auth.store";
|
import { useAuthStore } from "@/lib/stores/auth.store";
|
||||||
import { Button } from "@/components/ui/button";
|
import { Button } from "@/components/ui/button";
|
||||||
import { cn } from "@/lib/utils";
|
import { cn } from "@/lib/utils";
|
||||||
@@ -39,6 +40,13 @@ export function DemoDataBanner({ invalidateKeys, className }: Props) {
|
|||||||
qc.invalidateQueries({ queryKey: key });
|
qc.invalidateQueries({ queryKey: key });
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
onError: (err) => {
|
||||||
|
notify.error(
|
||||||
|
err instanceof ApiClientError
|
||||||
|
? err.message
|
||||||
|
: "افزودن دادههای نمونه ناموفق بود. دوباره تلاش کنید."
|
||||||
|
);
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!cafeId || (role !== "Owner" && role !== "Manager")) return null;
|
if (!cafeId || (role !== "Owner" && role !== "Manager")) return null;
|
||||||
|
|||||||
@@ -4,6 +4,11 @@ import { createNavigation } from "next-intl/navigation";
|
|||||||
export const routing = defineRouting({
|
export const routing = defineRouting({
|
||||||
locales: ["fa", "ar", "en"],
|
locales: ["fa", "ar", "en"],
|
||||||
defaultLocale: "fa",
|
defaultLocale: "fa",
|
||||||
|
// Iran-first: don't auto-pick the locale from the browser's Accept-Language
|
||||||
|
// (Persian users often have an en-US browser). A locale-less URL defaults to
|
||||||
|
// fa; the locale is otherwise taken from the URL prefix or the marketing-site
|
||||||
|
// link (e.g. app.meezi.ir/fa/login).
|
||||||
|
localeDetection: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
export const { Link, redirect, usePathname, useRouter } =
|
export const { Link, redirect, usePathname, useRouter } =
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ const fa = {
|
|||||||
desc: "از داشبورد میزی در دسترس است",
|
desc: "از داشبورد میزی در دسترس است",
|
||||||
value: "چت زنده",
|
value: "چت زنده",
|
||||||
cta: "ورود به داشبورد",
|
cta: "ورود به داشبورد",
|
||||||
href: "https://app.meezi.ir",
|
href: "https://app.meezi.ir/fa",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
officeTitle: "دفتر مرکزی",
|
officeTitle: "دفتر مرکزی",
|
||||||
@@ -79,7 +79,7 @@ const en = {
|
|||||||
desc: "Available inside the Meezi dashboard",
|
desc: "Available inside the Meezi dashboard",
|
||||||
value: "Live chat",
|
value: "Live chat",
|
||||||
cta: "Go to dashboard",
|
cta: "Go to dashboard",
|
||||||
href: "https://app.meezi.ir",
|
href: "https://app.meezi.ir/en",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
officeTitle: "Head Office",
|
officeTitle: "Head Office",
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ export function Navbar() {
|
|||||||
{locale === "fa" ? "EN" : "فا"}
|
{locale === "fa" ? "EN" : "فا"}
|
||||||
</button>
|
</button>
|
||||||
<a
|
<a
|
||||||
href="https://app.meezi.ir/login"
|
href={`https://app.meezi.ir/${locale}/login`}
|
||||||
className="rounded-lg px-3 py-2 text-sm font-medium text-gray-600 transition-colors hover:bg-gray-100 hover:text-gray-900"
|
className="rounded-lg px-3 py-2 text-sm font-medium text-gray-600 transition-colors hover:bg-gray-100 hover:text-gray-900"
|
||||||
>
|
>
|
||||||
{t("login")}
|
{t("login")}
|
||||||
@@ -143,7 +143,7 @@ export function Navbar() {
|
|||||||
</ul>
|
</ul>
|
||||||
<div className="mt-3 flex flex-col gap-2 border-t border-gray-100 pt-3">
|
<div className="mt-3 flex flex-col gap-2 border-t border-gray-100 pt-3">
|
||||||
<a
|
<a
|
||||||
href="https://app.meezi.ir/login"
|
href={`https://app.meezi.ir/${locale}/login`}
|
||||||
className="block rounded-lg px-3 py-2.5 text-center text-sm font-medium text-gray-600 hover:bg-gray-50"
|
className="block rounded-lg px-3 py-2.5 text-center text-sm font-medium text-gray-600 hover:bg-gray-50"
|
||||||
>
|
>
|
||||||
{t("login")}
|
{t("login")}
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ export function LaunchCountdownSection() {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<a
|
<a
|
||||||
href="https://app.meezi.ir/register"
|
href={`https://app.meezi.ir/${locale}/register`}
|
||||||
className={cn(
|
className={cn(
|
||||||
"inline-flex items-center justify-center rounded-xl bg-brand-700 px-6 py-3 text-sm font-semibold text-white",
|
"inline-flex items-center justify-center rounded-xl bg-brand-700 px-6 py-3 text-sm font-semibold text-white",
|
||||||
"transition hover:bg-brand-800 focus:outline-none focus-visible:ring-2 focus-visible:ring-brand-700 focus-visible:ring-offset-2"
|
"transition hover:bg-brand-800 focus:outline-none focus-visible:ring-2 focus-visible:ring-brand-700 focus-visible:ring-offset-2"
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ export function PricingSection() {
|
|||||||
priceNote: t("freePriceNote"),
|
priceNote: t("freePriceNote"),
|
||||||
desc: t("freeDesc"),
|
desc: t("freeDesc"),
|
||||||
cta: t("ctaFree"),
|
cta: t("ctaFree"),
|
||||||
href: "https://app.meezi.ir/register",
|
href: `https://app.meezi.ir/${locale}/register`,
|
||||||
features: [t("f1"), t("f2"), t("f3"), t("f4"), t("f5")],
|
features: [t("f1"), t("f2"), t("f3"), t("f4"), t("f5")],
|
||||||
popular: false,
|
popular: false,
|
||||||
variant: "outline",
|
variant: "outline",
|
||||||
|
|||||||
Reference in New Issue
Block a user