Removed creationDate & lastModifiedDate from Group; fixed flow issuses

This commit is contained in:
Philipp Czora
2018-07-31 19:05:06 +02:00
parent d532c36204
commit 58fbf4ebf2
4 changed files with 14 additions and 11 deletions

View File

@@ -26,14 +26,6 @@ class Details extends React.Component<Props> {
<td>{t("group.description")}</td>
<td>{group.description}</td>
</tr>
<tr>
<td>{t("group.creationDate")}</td>
<td>{new Date(group.creationDate).toString()}</td>
</tr>
<tr>
<td>{t("group.lastModified")}</td>
<td>{new Date(group.lastModified).toString()}</td>
</tr>
<tr>
<td>{t("group.type")}</td>
<td>{group.type}</td>

View File

@@ -6,9 +6,11 @@ import { translate } from "react-i18next";
import GroupForm from "./GroupForm";
import { connect } from "react-redux";
import { createGroup } from "../modules/groups";
import type { Group } from "../types/Group";
export interface Props {
t: string => string;
createGroup: Group => void;
}
export interface State {}

View File

@@ -18,7 +18,18 @@ export interface State {
class GroupForm extends React.Component<Props, State> {
constructor(props) {
super(props);
this.state = {};
this.state = {
group: {
name: "",
description: "",
_embedded: {
members: []
},
_links: {},
members: [],
type: "",
}
};
}
onSubmit = (event: Event) => {
event.preventDefault();

View File

@@ -4,9 +4,7 @@ import type { User } from "../../users/types/User";
export type Group = {
name: string,
creationDate: string,
description: string,
lastModified: string,
type: string,
members: string[],
_links: Links,