This repository has been archived on 2024-11-29. You can view files and clone it, but cannot push or open issues or pull requests.
2021-01-17 23:44:50 -05:00

45 lines
1.0 KiB
JavaScript

import React, { Component } from "react";
import ReportSingleMigration from "../common/Forms/ReportSingleMigration";
import { callAPI } from "../../actions/API";
// /migrations in the address bar,
// Allows the modification of migrations, and also populating a form
// by UUID,
// ReportSingleMigration is the actual form, witha PUT API request on that page.
export default class Migrations extends Component {
constructor(props) {
super(props);
this.state = {
migs: [],
redirect: false,
};
}
render() {
const onSubmit = async (migrationId, { setSubmitting }) => {
callAPI
.get(`/${migrationId.migrationId}/`)
.then((response) =>
this.setState({
redirect: true,
migs: response.data,
})
)
.catch(function (error) {
console.log(error);
});
setSubmitting(false);
};
return (
<div>
<ReportSingleMigration
key={this.state.migs.id}
item={this.state.migs}
/>
</div>
);
}
}