Skip to content

Commit

Permalink
fix: api token expiry time (#4165)
Browse files Browse the repository at this point in the history
  • Loading branch information
anmolsinghbhatia authored Apr 10, 2024
1 parent 43534dc commit 4f15c03
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions web/components/api-token/modal/form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export const CreateApiTokenForm: React.FC<Props> = (props) => {
else {
const expiryDate = getExpiryDate(data.expired_at ?? "");

if (expiryDate) payload.expired_at = renderFormattedPayloadDate(expiryDate);
if (expiryDate) payload.expired_at = renderFormattedPayloadDate(new Date(expiryDate));
}

await onSubmit(payload).then(() => {
Expand Down Expand Up @@ -170,8 +170,8 @@ export const CreateApiTokenForm: React.FC<Props> = (props) => {
{value === "custom"
? "Custom date"
: selectedOption
? selectedOption.label
: "Set expiration date"}
? selectedOption.label
: "Set expiration date"}
</div>
}
value={value}
Expand Down Expand Up @@ -207,8 +207,8 @@ export const CreateApiTokenForm: React.FC<Props> = (props) => {
? `Expires ${renderFormattedDate(customDate)}`
: null
: watch("expired_at")
? `Expires ${getExpiryDate(watch("expired_at") ?? "")}`
: null}
? `Expires ${getExpiryDate(watch("expired_at") ?? "")}`
: null}
</span>
)}
</div>
Expand Down

0 comments on commit 4f15c03

Please sign in to comment.