Skip to content

Commit

Permalink
feat: add desc and cred detail
Browse files Browse the repository at this point in the history
  • Loading branch information
mohamadch91 committed Dec 21, 2024
1 parent e74e273 commit 4663e14
Show file tree
Hide file tree
Showing 6 changed files with 539 additions and 463 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ import {
AppLayout,
Box,
Button,
FormField,
Header,
Input,
Modal,
Multiselect,
Pagination,
Expand Down Expand Up @@ -69,6 +71,7 @@ export default function UpdateCredentials({
const [credentialId, setCredentialId] = useState<string>('')
const [described, setDescribed] = useState<boolean>(false)
const [credentialType, setCredentialType] = useState<string>('')
const [description, setDescription] = useState<string>('')

const UpdateCredentials = () => {
setLoading(true)
Expand All @@ -90,6 +93,8 @@ export default function UpdateCredentials({
const formData = new FormData()
// @ts-ignore
formData.append('credential_type', credentialType)
formData.append('description', description)

Object.keys(credential).forEach((key) => {
formData.append(`credentials.${key}`, credential[key])
})
Expand Down Expand Up @@ -124,6 +129,7 @@ export default function UpdateCredentials({
const body = {
credentials: credential,
credential_type: credentialType,
description: description
}
axios
.put(
Expand Down Expand Up @@ -181,7 +187,9 @@ export default function UpdateCredentials({
credential_type:
cred.label,
})
setCredentialType(cred.label)
setCredentialType(
cred.label
)
}}
>
{cred.label}
Expand Down Expand Up @@ -224,6 +232,20 @@ export default function UpdateCredentials({
</>
)
})}
<FormField
className="w-full"
label={'Description'}
errorText={''}
>
<Input
className="w-full"
value={description}
type={'text'}
onChange={({ detail }) =>
setDescription(detail.value)
}
/>
</FormField>
</>
</Flex>
<Flex
Expand Down
Loading

0 comments on commit 4663e14

Please sign in to comment.