notification module
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
import { apiRequest, apiRequestWithETag } from "@/lib/api-client"
|
||||
import { ApiResult } from "@/types/common"
|
||||
import { NotificationConfig, UpdateNotificationConfigRequest } from "@/types/notifications"
|
||||
|
||||
export const notificationConfigApi = {
|
||||
get(): Promise<ApiResult<NotificationConfig>> {
|
||||
return apiRequestWithETag<NotificationConfig>("/notification-config")
|
||||
},
|
||||
|
||||
update(request: UpdateNotificationConfigRequest, ifMatch: string): Promise<ApiResult<NotificationConfig>> {
|
||||
return apiRequestWithETag<NotificationConfig>("/notification-config", { method: "PUT", body: request, ifMatch })
|
||||
},
|
||||
}
|
||||
@@ -1,9 +1,9 @@
|
||||
// Product configuration (docs/11-BACKEND-PHASE1.md §2.8; FR-MD-11). Singleton — no id.
|
||||
// Product configuration (docs/11-BACKEND-PHASE1.md §2.8; FR-MD-11). Singleton - no id.
|
||||
//
|
||||
// `subcategoriesEnabled`/`brandsEnabled` are enforced server-side: an item write carrying
|
||||
// a gated field while its flag is off returns 422 CONFIG_DISABLED. `itemTypesEnabled` is
|
||||
// ADVISORY — items hold no item-type reference, so there is nothing for the server to
|
||||
// reject; this frontend is what honours it by hiding the builder's type section.
|
||||
// ADVISORY - items hold no item-type reference, so there is nothing for the server to
|
||||
// reject; the frontend is what honours it by hiding the variant builder.
|
||||
import { apiRequest, apiRequestWithETag } from "@/lib/api-client"
|
||||
import { ApiResult } from "@/types/common"
|
||||
import { ProductConfig, UpdateProductConfigRequest } from "@/types/master-data"
|
||||
@@ -13,7 +13,7 @@ export const productConfigApi = {
|
||||
return apiRequestWithETag<ProductConfig>("/product-config")
|
||||
},
|
||||
|
||||
/** All three flags are required; a partial body is a 400, never a silent disable. */
|
||||
/** All flags are required; a partial body is a 400, never a silent disable. */
|
||||
update(request: UpdateProductConfigRequest, ifMatch: string): Promise<ApiResult<ProductConfig>> {
|
||||
return apiRequestWithETag<ProductConfig>("/product-config", { method: "PUT", body: request, ifMatch })
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user