👽 Update API to microservices

♻️ Refactor router pushes
This commit is contained in:
2025-07-17 14:35:09 +08:00
parent a7454edec0
commit e6c58b7b63
109 changed files with 9156 additions and 344 deletions

View File

@@ -9,10 +9,10 @@ part 'event_calendar.g.dart';
class EventCalendarQuery {
/// Username to fetch calendar for, null means current user ('me')
final String? uname;
/// Year to fetch calendar for
final int year;
/// Month to fetch calendar for
final int month;
@@ -43,14 +43,12 @@ Future<List<SnEventCalendarEntry>> eventCalendar(
EventCalendarQuery query,
) async {
final client = ref.watch(apiClientProvider);
final resp = await client.get('/accounts/${query.uname ?? 'me'}/calendar',
queryParameters: {
'year': query.year,
'month': query.month,
},
final resp = await client.get(
'/id/accounts/${query.uname ?? 'me'}/calendar',
queryParameters: {'year': query.year, 'month': query.month},
);
return resp.data
.map((e) => SnEventCalendarEntry.fromJson(e))
.cast<SnEventCalendarEntry>()
.toList();
}
}