Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagejs
import {Observable} from "rxjs/Rx";
import UserConstant from "../../../view/constant/UserConstant";
import LocationAction from "../../../view/action/LocationAction";

export default function () {
    let LocationEpic = function (action$) {
        let LocationService = require("../../../service/LocationService").default;
        return action$.ofType(UserConstant.USER_ASSIGN_POS)
            .mergeMap(action => Observable.from(
                LocationService.assignPos(
                    action.posId, action.locationId, action.currentStaffId))
                .map((response) => {
                    console.log(response);
                    return LocationAction.assignPosResponse();
                })
                .catch((error) =>{
                        return Observable.of(LocationAction.assignPosError(error.message));
                    }
                )
            );
    };
    LocationEpic.className = "LocationEpic";
    return LocationEpic;
}

Exercise: Hiển thị thêm thông tin về SKU trên trang product List sử dụng rewrite