-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4946971
commit f788004
Showing
6 changed files
with
32 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 1 addition & 7 deletions
8
ui/src/components/form-control/config.ts → ui/src/components/form-control/helpers.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
import FormControl from './FormControl.vue'; | ||
|
||
export * from './config'; | ||
export * from './helpers'; | ||
export * from './types'; | ||
|
||
export default FormControl; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
export type FormControlProps = { | ||
label?: string; | ||
required?: boolean; | ||
invalid?: boolean | string; | ||
help?: string; | ||
sub?: boolean; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import request from '../../utilities/request/request'; | ||
|
||
export const uploadImage = async (file: File, uploaded: (src: string) => Promise<void>) => { | ||
const formData = new FormData(); | ||
formData.append('file', file); | ||
|
||
const response = await request<{ url: string }>('/file-uploads', { | ||
method: 'POST', | ||
body: formData, | ||
}); | ||
|
||
if (response.ok && response._data) { | ||
uploaded(response._data.url); | ||
} | ||
}; |