Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
switchMap(action => {
const targetPath: string = action.payload.model.path;
const model: any = action.payload.model;
// Publish notebook to Bookstore
return bookstore.publish(serverConfig, targetPath, model).pipe(
tap((xhr: AjaxResponse) => {
if (xhr.status !== 200) {
throw new Error(xhr.response);
}
console.log("XHR: ", xhr);
}),
map(() => {
actions.publishToBookstoreSucceeded({
contentRef: action.payload.contentRef
});
}),
catchError((xhrError: any) =>
of(
actions.publishToBookstoreFailed({
error: xhrError,
contentRef: action.payload.contentRef