i18n
CI/CD Pipeline / Build and Push PocketBase Docker Image (push) Successful in 8s
CI/CD Pipeline / i18n Catalog Check (push) Failing after 10s
CI/CD Pipeline / Build and Push App Docker Image (push) Skipped
CI/CD Pipeline / Deploy to Kubernetes (push) Skipped

This commit is contained in:
yohlo
2026-08-08 15:29:40 -07:00
parent 22c282d8fa
commit 0a7b5fa00f
178 changed files with 13099 additions and 1285 deletions
+12 -7
View File
@@ -1,7 +1,9 @@
import { createFileRoute } from "@tanstack/react-router";
import { msg } from "@lingui/core/macro";
import { superTokensRequestMiddleware } from "@/utils/supertokens";
import { pbAdmin } from "@/lib/pocketbase/client";
import { logger } from "@/lib/logger";
import { localizedFor } from "@/lib/i18n/server-messages";
import { z } from "zod";
const uploadSchema = z.object({
@@ -13,6 +15,7 @@ export const Route = createFileRoute("/api/teams/upload-logo")({
middleware: [superTokensRequestMiddleware],
handlers: {
POST: async ({ request, context }) => {
const i18n = localizedFor(context.metadata);
try {
const userId = context.userAuthId;
const isAdmin = context.roles.includes("Admin");
@@ -27,7 +30,7 @@ export const Route = createFileRoute("/api/teams/upload-logo")({
if (!validationResult.success) {
return new Response(
JSON.stringify({
error: "Invalid input",
error: i18n._(msg`Invalid input`),
details: validationResult.error.issues,
}),
{
@@ -40,7 +43,7 @@ export const Route = createFileRoute("/api/teams/upload-logo")({
if (!logoFile || logoFile.size === 0) {
return new Response(
JSON.stringify({
error: "Logo file is required",
error: i18n._(msg`Logo file is required`),
}),
{
status: 400,
@@ -58,7 +61,9 @@ export const Route = createFileRoute("/api/teams/upload-logo")({
if (!allowedTypes.includes(logoFile.type)) {
return new Response(
JSON.stringify({
error: "Invalid file type. Only JPEG, PNG and GIF are allowed.",
error: i18n._(
msg`Invalid file type. Only JPEG, PNG and GIF are allowed.`
),
}),
{
status: 400,
@@ -71,7 +76,7 @@ export const Route = createFileRoute("/api/teams/upload-logo")({
if (logoFile.size > maxSize) {
return new Response(
JSON.stringify({
error: "File too large. Maximum size is 10MB.",
error: i18n._(msg`File too large. Maximum size is 10MB.`),
}),
{
status: 400,
@@ -84,7 +89,7 @@ export const Route = createFileRoute("/api/teams/upload-logo")({
if (!team) {
return new Response(
JSON.stringify({
error: "Team not found",
error: i18n._(msg`Team not found`),
}),
{
status: 404,
@@ -132,8 +137,8 @@ export const Route = createFileRoute("/api/teams/upload-logo")({
return new Response(
JSON.stringify({
error: "Failed to upload logo",
message: error.message || "Unknown error occurred",
error: i18n._(msg`Failed to upload logo`),
message: error.message || i18n._(msg`Unknown error occurred`),
}),
{
status: 500,