Skip to content

Commit

Permalink
fix: bug with auth config when creating rather than editing route
Browse files Browse the repository at this point in the history
  • Loading branch information
kabaros committed Oct 14, 2024
1 parent a302005 commit 0efdb4f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/route-creation/UpsertRoute.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,10 @@ const UpsertRoute: React.FC<UpsertRouteProps> = ({
// @ts-expect-error("we need the ID to be dynamic, which is allowed but not reflected in the type")
const [updateRoute] = useDataMutation(updateRouteMutation, options)

const updateAuthConfig = (update: Partial<RouteAuthConfig>) => {
const updateAuthConfig = (update: Partial<RouteAuthConfig> = {}) => {
setAuthConfig((data) => {
// reset properties if changing auth type
if (update.type && update.type !== data.type) {
if (update.type && data?.type && update.type !== data.type) {
return update
}

Expand Down

0 comments on commit 0efdb4f

Please sign in to comment.