Fix a couple target bugs

This commit is contained in:
Owen Schwartz 2024-11-23 18:21:11 -05:00
parent 5ae25b8b37
commit 3ac76f0be9

View file

@ -171,7 +171,7 @@ export default function ReverseProxyTargets(props: {
updateResource({ ssl: sslEnabled });
for (const target of targets) {
for (let target of targets) {
const data = {
ip: target.ip,
port: target.port,
@ -184,6 +184,7 @@ export default function ReverseProxyTargets(props: {
const res = await api.put<
AxiosResponse<CreateTargetResponse>
>(`/resource/${params.resourceId}/target`, data);
target.targetId = res.data.data.targetId;
} else if (target.updated) {
const res = await api.post(
`/target/${target.targetId}`,
@ -193,11 +194,12 @@ export default function ReverseProxyTargets(props: {
setTargets([
...targets.map((t) => {
return {
let res = {
...t,
new: false,
updated: false,
};
return res;
}),
]);
}