import { getUrl } from "../helper";
import { authedFunction } from "../session";

export const notificationActions = {
	getAppNotificationSetting: () => {
		return authedFunction({
			method: "GET",
			url: getUrl("notifications", "getState/get", {
				type: "app",
			}),
		});
	},
	muteApp: () => {
		return authedFunction({
			method: "POST",
			url: getUrl("notifications", "updateState/mute"),
			data: { type: "app" },
		});
	},
	unmuteApp: () => {
		return authedFunction({
			method: "POST",
			url: getUrl("notifications", "updateState/unmute"),
			data: { type: "app" },
		});
	},
	getEntityNotificationSetting: (type, id) => {
		return authedFunction({
			method: "GET",
			url: getUrl("notifications", "getState/get", { type, id }),
		});
	},
	muteEntity: (type, id) => {
		return authedFunction({
			method: "POST",
			url: getUrl("notifications", "updateState/mute"),
			data: { type, id },
		});
	},
	unmuteEntity: (type, id) => {
		return authedFunction({
			method: "POST",
			url: getUrl("notifications", "updateState/unmute"),
			data: { type, id },
		});
	},
};
