#28 Fix eslint warning
This commit is contained in:
parent
4bac42f2c7
commit
ce343c8c21
|
@ -13,26 +13,16 @@ export const GET_ALL_PAGE_INFO = gql`
|
|||
}
|
||||
`;
|
||||
|
||||
export interface GetAllPageInfoResponse {
|
||||
allUserAppInfos: {
|
||||
nodes: Array<{
|
||||
id: string;
|
||||
rowId: string;
|
||||
title: string;
|
||||
content: string;
|
||||
}>;
|
||||
__typename: "UserAppInfosConnection";
|
||||
};
|
||||
export interface PageInfo {
|
||||
id: string;
|
||||
rowId: string;
|
||||
title: string;
|
||||
content: string;
|
||||
}
|
||||
|
||||
export interface GetPageInfoResponse {
|
||||
userAppInfo(id: string): {
|
||||
nodes: Array<{
|
||||
id: string;
|
||||
rowId: string;
|
||||
title: string;
|
||||
content: string;
|
||||
}>;
|
||||
export interface GetAllPageInfoResponse {
|
||||
allUserAppInfos: {
|
||||
nodes: Array<PageInfo>;
|
||||
__typename: "UserAppInfosConnection";
|
||||
};
|
||||
}
|
||||
|
|
|
@ -5,6 +5,7 @@ import { useQuery } from "@apollo/client";
|
|||
import {
|
||||
GET_ALL_PAGE_INFO,
|
||||
GetAllPageInfoResponse,
|
||||
PageInfo,
|
||||
} from "../backend/queries/page_info";
|
||||
import { EditInformationField } from "./EditInformationField";
|
||||
|
||||
|
@ -38,12 +39,12 @@ export function EditInformation(
|
|||
const classes = useStyles();
|
||||
|
||||
return (
|
||||
<div>
|
||||
<React.Fragment>
|
||||
<Typography component={"h2"} variant="h6" gutterBottom>
|
||||
Bearbeite hier die Webseiten Info-Texte für deinen Candymat:
|
||||
</Typography>
|
||||
<Paper className={classes.root}>
|
||||
{infos.map((info) => {
|
||||
{infos.map((info: PageInfo) => {
|
||||
return (
|
||||
<EditInformationField
|
||||
loggedInPersonRowId={props.loggedInPersonRowId}
|
||||
|
@ -53,6 +54,6 @@ export function EditInformation(
|
|||
);
|
||||
})}
|
||||
</Paper>
|
||||
</div>
|
||||
</React.Fragment>
|
||||
);
|
||||
}
|
||||
|
|
|
@ -4,6 +4,7 @@ import { makeStyles } from "@material-ui/core/styles";
|
|||
import { useMutation } from "@apollo/client";
|
||||
import { Save } from "@material-ui/icons";
|
||||
import { EDIT_INFOS, EditInfosResponse } from "../backend/mutations/page_info";
|
||||
import { PageInfo } from "../backend/queries/page_info";
|
||||
|
||||
const useStyles = makeStyles((theme) => ({
|
||||
root: {
|
||||
|
@ -23,12 +24,7 @@ const useStyles = makeStyles((theme) => ({
|
|||
}));
|
||||
|
||||
interface EditInformationFieldProps {
|
||||
info: {
|
||||
id: string;
|
||||
rowId: string;
|
||||
title: string;
|
||||
content: string;
|
||||
};
|
||||
info: PageInfo;
|
||||
loggedInPersonRowId: number;
|
||||
}
|
||||
|
||||
|
@ -42,9 +38,9 @@ export function EditInformationField(
|
|||
if (loading) console.log("Loading");
|
||||
if (error) return <p>An error occurred</p>;
|
||||
|
||||
function changeInfo(e: any) {
|
||||
function changeInfo(e: React.ChangeEvent<HTMLTextAreaElement>) {
|
||||
const changeInfoText = e.target.value;
|
||||
setInfo(changeInfoText);
|
||||
setInfo({ ...info, content: changeInfoText });
|
||||
}
|
||||
|
||||
return (
|
||||
|
|
Loading…
Reference in a new issue