mirror of
https://github.com/khoaliber/LetterFeed.git
synced 2026-03-02 13:18:27 +00:00
feat: process now button
This commit is contained in:
@@ -1,26 +1,27 @@
|
||||
import type { Metadata } from "next";
|
||||
import { Geist, Geist_Mono } from "next/font/google";
|
||||
import "./globals.css";
|
||||
import type { Metadata } from "next"
|
||||
import { Geist, Geist_Mono } from "next/font/google"
|
||||
import "./globals.css"
|
||||
import { Toaster } from "@/components/ui/sonner"
|
||||
|
||||
const geistSans = Geist({
|
||||
variable: "--font-geist-sans",
|
||||
subsets: ["latin"],
|
||||
});
|
||||
})
|
||||
|
||||
const geistMono = Geist_Mono({
|
||||
variable: "--font-geist-mono",
|
||||
subsets: ["latin"],
|
||||
});
|
||||
})
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: "LetterFeed",
|
||||
description: "Read your newsletters as RSS feeds!",
|
||||
};
|
||||
}
|
||||
|
||||
export default function RootLayout({
|
||||
children,
|
||||
}: Readonly<{
|
||||
children: React.ReactNode;
|
||||
children: React.ReactNode
|
||||
}>) {
|
||||
return (
|
||||
<html lang="en">
|
||||
@@ -28,7 +29,8 @@ export default function RootLayout({
|
||||
className={`${geistSans.variable} ${geistMono.variable} antialiased`}
|
||||
>
|
||||
{children}
|
||||
<Toaster />
|
||||
</body>
|
||||
</html>
|
||||
);
|
||||
)
|
||||
}
|
||||
|
||||
@@ -137,6 +137,18 @@ export async function testImapConnection(): Promise<{ message: string }> {
|
||||
return response.json();
|
||||
}
|
||||
|
||||
export async function processEmails(): Promise<{ message: string }> {
|
||||
const response = await fetch(`${API_BASE_URL}/imap/process`, {
|
||||
method: 'POST',
|
||||
});
|
||||
if (!response.ok) {
|
||||
const error = await response.json();
|
||||
throw new Error(error.detail || "Failed to process emails");
|
||||
}
|
||||
return response.json();
|
||||
}
|
||||
|
||||
export function getFeedUrl(newsletterId: number): string {
|
||||
return `${API_BASE_URL}/feeds/${newsletterId}`;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user