Skip to content

Commit

Permalink
Fix reroll key when selecting "now" as expiration time
Browse files Browse the repository at this point in the history
  • Loading branch information
hiroasano committed Sep 11, 2024
1 parent 023206f commit db4c22c
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ export const RerollKey: React.FC<Props> = ({ apiKey, apiId, lastUsed }: Props) =
await updateNewKey.mutateAsync({ roleId: role.roleId, keyId: newKey.keyId });
});

const miliseconds = ms(values.expiresIn);
const miliseconds = values.expiresIn === "now" ? 0 : ms(values.expiresIn);
const deletedAt = new Date(Date.now() + miliseconds);

await updateDeletedAt.mutate({
Expand Down

0 comments on commit db4c22c

Please sign in to comment.