внедрил пресеты статусов и модульную архитектуру

This commit is contained in:
max
2026-04-18 00:43:46 +03:00
parent e8c9a55fe9
commit f4f61071ed
32 changed files with 665 additions and 110 deletions
@@ -0,0 +1,31 @@
import { httpClient } from '../../../core/infrastructure/httpClient';
import type { User, StatusPreset } from '../../../core/domain/types';
export class StatusApi {
static async getPresets(): Promise<StatusPreset[]> {
return httpClient.request<StatusPreset[]>('/statuses/presets');
}
static async setCustom(body: {
emoji?: string | null;
text?: string | null;
expiresAt?: string | null;
presetKey?: string | null;
}): Promise<User> {
return httpClient.request<User>('/statuses/custom', {
method: 'POST',
body: JSON.stringify({
emoji: body.emoji ?? '',
text: body.text ?? '',
expiresAt: body.expiresAt ?? null,
presetKey: body.presetKey ?? null,
}),
});
}
static async clear(): Promise<User> {
return httpClient.request<User>('/statuses/', {
method: 'DELETE',
});
}
}