optimize: api resp size.
Some checks failed
Build and Push Docker Image / buildx (push) Has been cancelled

This commit is contained in:
2025-11-11 17:06:17 +08:00
parent 96042461f9
commit 68d13112ec
4 changed files with 158 additions and 109 deletions

View File

@@ -53,14 +53,22 @@ export async function fetchCurrentUser(server, token) {
return request(server, '/api/auth/me', { token });
}
export async function fetchCalendar(server, token) {
return request(server, '/api/calendar', { token });
export async function fetchCalendar(server, token, year, month) {
const params = new URLSearchParams();
if (year !== undefined && month !== undefined) {
params.append('year', year);
params.append('month', month);
}
const queryString = params.toString();
const path = queryString ? `/api/calendar?${queryString}` : '/api/calendar';
return request(server, path, { token });
}
export async function saveCalendar(server, token, markedDates) {
export async function saveCalendar(server, token, markedDates, deletedDates) {
return request(server, '/api/calendar', {
method: 'POST',
token,
body: { markedDates }
body: { markedDates, deletedDates }
});
}