adding and removing teams works

This commit is contained in:
Carter 2024-11-19 12:32:07 -06:00
parent 952b3f6c4e
commit cf4e3fbe1f
7 changed files with 46 additions and 19 deletions

View file

@ -45,17 +45,17 @@ export default function RemoveSelfFromObject(props: Props) {
})
)
])
.then((response: any) => {
.then(() => {
success("Successfully left " + label);
close(true);
navigate("/" + (path !== undefined ? path : scope.kind) + "s");
})
.catch((err: any) => {
err.response.data.error
? warning(err.response.data.error)
: error("Error occured when trying to remove yourself from " + label);
close(false);
});
// .catch((err: any) => {
// err.response.data.error
// ? warning(err.response.data.error)
// : error("Error occured when trying to remove yourself from " + label);
// close(false);
// });
};
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ UI BEGINS ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@ -70,11 +70,15 @@ export default function RemoveSelfFromObject(props: Props) {
</Typography>
</DialogContent>
<DialogActions>
<Button onClick={() => close(false)} color="primary">
Cancel
<Button onClick={() => close(false)}>
<Typography color="textPrimary" variant="body2">
Cancel
</Typography>
</Button>
<Button onClick={submit} color="primary" autoFocus>
Leave
<Typography color="warning" variant="body2">
Leave
</Typography>
</Button>
</DialogActions>
</React.Fragment>