Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

[PROD] Release: Job Start Date #511

Merged
merged 2 commits into from
Oct 11, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/routes/JobForm/index.jsx
Original file line number Diff line number Diff line change
@@ -8,6 +8,7 @@
import React, { useState, useEffect } from "react";
import PT from "prop-types";
import { toastr } from "react-redux-toastr";
import moment from 'moment';
import _ from "lodash";
import store from "../../store";
import Page from "components/Page";
@@ -33,6 +34,9 @@ const JobForm = ({ teamId, jobId }) => {
const title = isEdit ? "Edit Job Details" : "Create Job";

const onSubmit = async (values) => {
if (values.startDate) {
values.startDate = moment(values.startDate).format('YYYY-MM-DD')
}
if (isEdit) {
await updateJob(values, jobId).then(
() => {
8 changes: 7 additions & 1 deletion src/services/teams.js
Original file line number Diff line number Diff line change
@@ -5,7 +5,8 @@ import {
axiosInstance as axios,
fetchCustom as fetch,
} from "./requestInterceptor";

import _ from "lodash";
import moment from "moment";
import config from "../../config";

/**
@@ -257,6 +258,11 @@ export const searchRoles = (searchObject) => {
* @returns {Promise<object>} object containing new projectId
*/
export const postTeamRequest = (teamObject) => {
_.forEach(teamObject.positions, (p) => {
if (p.startMonth) {
p.startMonth = moment(p.startMonth).format("YYYY-MM-DD");
}
});
const url = `${config.API.V5}/taas-teams/submitTeamRequest`;
return axios.post(url, teamObject);
};