feat: 接通后台渲染异常上报与响应契约校验
This commit is contained in:
1 parent
330d67adc1
commit
adcaa12970
22 files changed
+845
-33
No files matched your search
@@ -1,5 +1,6 @@
|
||||
import type { BookingStatus } from "@personal-brand/types";
|
||||
import type { RequestFn } from "../client/request.js";
|
||||
import { adminBookingListSchema, adminBookingTagListSchema } from "../schemas/admin-collections.js";
|
||||
import type {
|
||||
AdminBooking,
|
||||
Booking,
|
||||
@@ -38,7 +39,9 @@ export function bookingMethods({ request }: { request: RequestFn }): BookingMeth
|
||||
if (filters.unreadOnly !== undefined) params.push(`unreadOnly=${filters.unreadOnly}`);
|
||||
if (filters.tagId) params.push(`tagId=${encodeURIComponent(filters.tagId)}`);
|
||||
const query = params.join("&");
|
||||
return request(`/admin/bookings${query ? `?${query}` : ""}`);
|
||||
return request(`/admin/bookings${query ? `?${query}` : ""}`, {
|
||||
expect: adminBookingListSchema,
|
||||
});
|
||||
},
|
||||
getAdminBooking: (id) => request(`/admin/bookings/${encodeURIComponent(id)}`),
|
||||
getAdminUnreadCount: () => request("/admin/bookings/unread-count"),
|
||||
@@ -49,7 +52,7 @@ export function bookingMethods({ request }: { request: RequestFn }): BookingMeth
|
||||
}),
|
||||
markAdminBookingRead: (id) =>
|
||||
request(`/admin/bookings/${encodeURIComponent(id)}/read`, { method: "POST" }),
|
||||
listAdminTags: () => request("/admin/bookings/tags"),
|
||||
listAdminTags: () => request("/admin/bookings/tags", { expect: adminBookingTagListSchema }),
|
||||
createAdminTag: (name) => request("/admin/bookings/tags", { method: "POST", body: { name } }),
|
||||
};
|
||||
}
|
||||
Reference in new issue
Block a user