fixes notifications & trail recommendations

This commit is contained in:
Christian Beutel
2025-03-17 14:50:28 +01:00
parent d23444c799
commit a214d1052a
5 changed files with 12 additions and 16 deletions

View File

@@ -106,7 +106,7 @@
<div class="dropdown relative">
{#if unreadCount > 0}
<div
class="absolute pointer-events-none -top-1 left-4 text-sm rounded-full bg-content text-content-inverse px-1 text-center"
class="absolute pointer-events-none -top-[2px] left-5 text-xs rounded-full bg-content text-content-inverse px-1 text-center"
>
{unreadCount}{unreadCount >= 10 ? "+" : ""}
</div>

View File

@@ -1,6 +1,7 @@
import type { Settings } from "./settings";
import { type AuthRecord } from "pocketbase";
export type User = {
export type User = AuthRecord & {
id: string,
username?: string,
email?: string,

View File

@@ -6,7 +6,7 @@ let notifications: Notification[] = [];
export async function notifications_index(data: { recipient: string, seen?: boolean }, page: number = 1, perPage: number = 10, f: (url: RequestInfo | URL, config?: RequestInit) => Promise<Response> = fetch) {
const r = await f('/api/v1/notification?' + new URLSearchParams({
filter: `created>=@month&&recipient='${data.recipient}'` + (data.seen !== undefined ? `&&seen=${data.seen}` : ''),
filter: `created<=@month&&recipient='${data.recipient}'` + (data.seen !== undefined ? `&&seen=${data.seen}` : ''),
sort: '+seen,-created',
page: page.toString(),
"perPage": perPage.toString()