chore(challenges-utils): Typescript migration of Challenges util postUpdate$.js (#45601)

* Rename to .ts

* Typescript migration of Challenges/utils/postUpdate$.js
This commit is contained in:
sjkadali
2022-04-02 05:58:11 -04:00
committed by GitHub
parent 40a6abe1b0
commit ca33332a38
4 changed files with 16 additions and 8 deletions

View File

@@ -13,7 +13,7 @@ import { v4 as uuid } from 'uuid';
import { backEndProject } from '../../utils/challenge-types'; import { backEndProject } from '../../utils/challenge-types';
import { isGoodXHRStatus } from '../templates/Challenges/utils'; import { isGoodXHRStatus } from '../templates/Challenges/utils';
import postUpdate$ from '../templates/Challenges/utils/postUpdate$'; import postUpdate$ from '../templates/Challenges/utils/post-update';
import { actionTypes } from './action-types'; import { actionTypes } from './action-types';
import { import {
serverStatusChange, serverStatusChange,

View File

@@ -20,7 +20,7 @@ import {
updateFailed updateFailed
} from '../../../redux'; } from '../../../redux';
import postUpdate$ from '../utils/postUpdate$'; import postUpdate$ from '../utils/post-update';
import { mapFilesToChallengeFiles } from '../../../utils/ajax'; import { mapFilesToChallengeFiles } from '../../../utils/ajax';
import { standardizeRequestBody } from '../../../utils/challenge-request-helpers'; import { standardizeRequestBody } from '../../../utils/challenge-request-helpers';
import { actionTypes } from './action-types'; import { actionTypes } from './action-types';

View File

@@ -0,0 +1,14 @@
import { from, Observable } from 'rxjs';
import { post } from '../../../utils/ajax';
interface PostData {
endpoint: string;
payload: unknown;
}
export default function postUpdate$({
endpoint,
payload
}: PostData): Observable<void> {
return from(post(endpoint, payload));
}

View File

@@ -1,6 +0,0 @@
import { from } from 'rxjs';
import { post } from '../../../utils/ajax';
export default function postUpdate$({ endpoint, payload }) {
return from(post(endpoint, payload));
}