Новые правки на сайте
This commit is contained in:
parent
261d5db2d7
commit
f6f2fb3a35
7 changed files with 106 additions and 6 deletions
|
|
@ -350,10 +350,11 @@ import { COMPANY } from "@constants";
|
|||
|
||||
// Скрываем телефон, показываем аватар и кнопку выхода
|
||||
if (phoneEl) phoneEl.style.display = 'none';
|
||||
const displayName = user.name || user.email || 'Пользователь';
|
||||
|
||||
authSection.innerHTML = `
|
||||
<div class="user-display">
|
||||
<div class="user-avatar" title="${user.name || user.email}">${firstLetter}</div>
|
||||
<div class="user-avatar" title="${displayName}">${firstLetter}</div>
|
||||
<button class="logout-btn" id="logout-btn" title="Выйти">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"></path>
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ export async function getPosts(options?: {
|
|||
return {
|
||||
posts: (result.items || []) as unknown as Post[],
|
||||
total: result.totalItems || 0,
|
||||
page: (result.pageInfo?.page || 1),
|
||||
page: result.page || 1,
|
||||
totalPages: result.totalPages || 1,
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ export const POST: APIRoute = async ({ request, cookies }) => {
|
|||
token: authData.token,
|
||||
user: {
|
||||
id: authData.record.id,
|
||||
name: authData.record.name || authData.record.firstName,
|
||||
name: authData.record.firstName,
|
||||
email: authData.record.email,
|
||||
}
|
||||
}), { status: 200 });
|
||||
|
|
|
|||
|
|
@ -50,8 +50,8 @@ export const GET: APIRoute = async ({ url }) => {
|
|||
image: getImageUrl(post),
|
||||
})),
|
||||
total: result.totalItems,
|
||||
page: result.pageInfo.page,
|
||||
perPage: result.pageInfo.perPage,
|
||||
page: result.page,
|
||||
perPage: result.perPage,
|
||||
totalPages: result.totalPages,
|
||||
}), { status: 200 });
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@
|
|||
"include": [".astro/types.d.ts", "**/*"],
|
||||
"exclude": ["dist"],
|
||||
"compilerOptions": {
|
||||
"ignoreDeprecations": "6.0",
|
||||
"baseUrl": ".",
|
||||
"paths": {
|
||||
"@styles/*": ["src/styles/*"],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue