'use client'
import {
  m2mNotifications_v1
} from "./chunk-ISOF65DB.mjs";

// src/notification/api.ts
import { fetcher } from "matsuri-hooks";
var requestUpdateNotificationStatusToRead = async (token, id) => {
  await fetcher(
    m2mNotifications_v1.updateNotificationStatus({
      id
    }),
    {
      method: "PUT",
      token,
      body: JSON.stringify({ status: "read" })
    }
  );
};
var requestSubscribe = async (token, serviceId, input) => {
  const { error } = await fetcher(m2mNotifications_v1.saveSubscription(), {
    method: "POST",
    token,
    body: JSON.stringify({
      ...input,
      serviceId,
      status: "subscribed"
    })
  });
  if (error) {
    console.error(error);
  }
};
var requestUnSubscribe = async (token, serviceId, input) => {
  const { error } = await fetcher(m2mNotifications_v1.saveSubscription(), {
    method: "POST",
    token,
    body: JSON.stringify({
      ...input,
      serviceId,
      status: "denied"
    })
  });
  if (error) {
    console.error(error);
  }
};

export {
  requestUpdateNotificationStatusToRead,
  requestSubscribe,
  requestUnSubscribe
};
//# sourceMappingURL=chunk-V4ROE7DI.mjs.map