luna command alarm example
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
import { URLS } from "../api/apiConfig";
|
||||
import { TAxios } from "../api/TAxios";
|
||||
import { deleteReservation } from "../lunaSend";
|
||||
import { CATEGORY_DATA_MAX_RESULTS_LIMIT } from "../utils/Config";
|
||||
import * as HelperMethods from "../utils/helperMethods";
|
||||
import { types } from "./actionTypes";
|
||||
import { changeAppStatus } from "./commonActions";
|
||||
import { addReservation, changeAppStatus } from "./commonActions";
|
||||
|
||||
export const getMainLiveShow = (props) => (dispatch, getState) => {
|
||||
const onSuccess = (response) => {
|
||||
@@ -30,12 +31,63 @@ export const getMainLiveShow = (props) => (dispatch, getState) => {
|
||||
onFail
|
||||
);
|
||||
};
|
||||
|
||||
// Live 알람 설정/해제 IF-LGSP-012
|
||||
export const setMainLiveUpcomingAlarm = (props) => (dispatch, getState) => {
|
||||
const { alamDispFlag, endDt, patnrId, showId, strtDt } = props;
|
||||
|
||||
const onSuccess = (response) => {
|
||||
console.log("@@ setMainLiveUpcomingAlarm onSuccess", response.data);
|
||||
|
||||
/* ---------------------------------------------- example
|
||||
|
||||
if (alamDispFlag === "Y") {
|
||||
const data = {
|
||||
startTime: {
|
||||
year: new Date(strtDt).getFullYear(),
|
||||
month: new Date(strtDt).getMonth() + 1,
|
||||
day: new Date(strtDt).getDate(),
|
||||
hour: new Date(strtDt).getHours(),
|
||||
minute: new Date(strtDt).getMinutes(),
|
||||
second: new Date(strtDt).getSeconds()
|
||||
},
|
||||
params: {
|
||||
message: "add Message",
|
||||
buttons: [
|
||||
{
|
||||
label: HelperMethods.$L("yes")
|
||||
},
|
||||
{
|
||||
label: HelperMethods.$L("no")
|
||||
}
|
||||
],
|
||||
launch: {
|
||||
contentTarget: `V3_진입경로코드_진입경로명_LS_${patnrId}_${chanId}`
|
||||
},
|
||||
showId: showId
|
||||
}
|
||||
}
|
||||
|
||||
dispatch(addReservation(data, {
|
||||
onSuccess: (res) => {
|
||||
console.log("LUNA SEND addReservation success", res);
|
||||
},
|
||||
onFailure: (err) => {
|
||||
console.log("LUNA SEND addReservation failed", err);
|
||||
}
|
||||
}))
|
||||
} else if (alamDispFlag === "N") {
|
||||
dispatch(deleteReservation(showId, {
|
||||
onSuccess: (res) => {
|
||||
console.log("LUNA SEND deleteReservation success", res);
|
||||
},
|
||||
onFailure: (err) => {
|
||||
console.log("LUNA SEND deleteReservation failed", err);
|
||||
},
|
||||
}))
|
||||
}
|
||||
|
||||
---------------------------------------------- */
|
||||
};
|
||||
|
||||
const onFail = (error) => {
|
||||
|
||||
@@ -206,11 +206,11 @@ export const addReservation = (data) => {
|
||||
parameters: {
|
||||
scheduleType: "LGShopping",
|
||||
startTime: {
|
||||
year: data.startTime.year,
|
||||
month: data.startTime.month,
|
||||
day: data.startTime.day,
|
||||
hour: data.startTime.hour,
|
||||
minute: data.startTime.minute,
|
||||
year: data.startTime.year,
|
||||
second: data.startTime.second,
|
||||
},
|
||||
callback: {
|
||||
|
||||
@@ -19,7 +19,11 @@ import {
|
||||
getBrandShowroom,
|
||||
getBrandTSVInfo,
|
||||
} from "../../actions/brandActions";
|
||||
import { changeAppStatus, setHidePopup } from "../../actions/commonActions";
|
||||
import {
|
||||
changeAppStatus,
|
||||
deleteReservation,
|
||||
setHidePopup,
|
||||
} from "../../actions/commonActions";
|
||||
import { setMainLiveUpcomingAlarm } from "../../actions/mainActions";
|
||||
import {
|
||||
deleteMyUpcomingAlertShow,
|
||||
@@ -595,6 +599,21 @@ export default function FeaturedBrandsPanel({
|
||||
if (activePopup?.type === ACTIVE_POPUP.timeConflictPopup) {
|
||||
const { upcomingAlarmInfo, deletedAlertShows } = activePopup;
|
||||
|
||||
/* ---------------------------------------------- example
|
||||
|
||||
dispatch(deleteReservation(deletedAlertShows, {
|
||||
onSuccess: (res) => {
|
||||
console.log("LUNA SEND deleteReservation success", res);
|
||||
dispatch(setMainLiveUpcomingAlarm(upcomingAlarmInfo));
|
||||
dispatch(deleteMyUpcomingAlertShow({ showList: deletedAlertShows }));
|
||||
},
|
||||
onFailure: (err) => {
|
||||
console.log("LUNA SEND deleteReservation failed", err);
|
||||
}
|
||||
}));
|
||||
|
||||
---------------------------------------------- */
|
||||
|
||||
dispatch(setMainLiveUpcomingAlarm(upcomingAlarmInfo));
|
||||
dispatch(deleteMyUpcomingAlertShow({ showList: deletedAlertShows }));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user