Reformat all project files to use the prettier config file.

This commit is contained in:
Patrick Fic
2024-03-27 15:35:07 -07:00
parent b161530381
commit e1df64d592
873 changed files with 111387 additions and 125473 deletions

View File

@@ -1,51 +1,47 @@
import {InputNumber, notification} from "antd";
import React, {useState} from "react";
import {useMutation} from "@apollo/client";
import {useTranslation} from "react-i18next";
import {UPDATE_ASSOCIATION} from "../../graphql/user.queries";
import { InputNumber, notification } from "antd";
import React, { useState } from "react";
import { useMutation } from "@apollo/client";
import { useTranslation } from "react-i18next";
import { UPDATE_ASSOCIATION } from "../../graphql/user.queries";
export default function ShopUsersAuthEdit({association}) {
const {t} = useTranslation();
const [updateAssociation] = useMutation(UPDATE_ASSOCIATION);
const [open, setOpen] = useState(false);
const [value, setValue] = useState(association.authlevel);
export default function ShopUsersAuthEdit({ association }) {
const { t } = useTranslation();
const [updateAssociation] = useMutation(UPDATE_ASSOCIATION);
const [open, setOpen] = useState(false);
const [value, setValue] = useState(association.authlevel);
const handleSave = async () => {
setOpen(false);
const result = await updateAssociation({
variables: {
assocId: association.id,
assoc: {authlevel: value},
},
});
const handleSave = async () => {
setOpen(false);
const result = await updateAssociation({
variables: {
assocId: association.id,
assoc: { authlevel: value }
}
});
if (!!result.errors) {
notification["error"]({
message: t("user.errors.updating", {
message: JSON.stringify(result.errors),
}),
});
}
};
if (!!result.errors) {
notification["error"]({
message: t("user.errors.updating", {
message: JSON.stringify(result.errors)
})
});
}
};
return (
return (
<div>
{open && (
<div>
{open && (
<div>
<InputNumber
min={0}
value={value}
onChange={(val) => setValue(val)}
defaultValue={association.authlevel}
onBlur={handleSave}
/>
</div>
)}
{!open && (
<div style={{cursor: "pointer"}}>
{association.authlevel || t("general.labels.na")}
</div>
)}
<InputNumber
min={0}
value={value}
onChange={(val) => setValue(val)}
defaultValue={association.authlevel}
onBlur={handleSave}
/>
</div>
);
)}
{!open && <div style={{ cursor: "pointer" }}>{association.authlevel || t("general.labels.na")}</div>}
</div>
);
}