This repository was archived by the owner on Sep 3, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +5
-45
lines changed
apps/docs/src/app/test/upload-img Expand file tree Collapse file tree 1 file changed +5
-45
lines changed Original file line number Diff line number Diff line change @@ -25,11 +25,11 @@ export default function Page() {
2525 const blob = await compressImage ( image ) ;
2626 if ( ! blob ) return ;
2727
28- const res = await authClient . profileImage . upload ( {
29- image : blob ,
30- test : 2 ,
31- } ) ;
32- console . log ( res ) ;
28+ // const res = await authClient.profileImage.upload({
29+ // image: blob,
30+ // test: 2,
31+ // });
32+ // console.log(res);
3333 } ;
3434
3535 return (
@@ -67,43 +67,3 @@ export default function Page() {
6767 </ div >
6868 ) ;
6969}
70-
71- function UploadProfileImage ( ) {
72- const [ image , setImage ] = useState < File | null > ( null ) ;
73-
74- const handleFileChange = async ( e : React . ChangeEvent < HTMLInputElement > ) => {
75- const file = e . target . files ?. [ 0 ] ;
76- if ( ! file ) return ;
77- setImage ( file ) ;
78- } ;
79-
80- const uploadImage = async ( ) => {
81- if ( ! image ) return ;
82-
83- const blob = await compressImage ( image ) ;
84- if ( ! blob ) return ;
85-
86- const { data, error } = await authClient . profileImage . upload ( {
87- image : blob ,
88- } ) ;
89-
90- if ( data ) {
91- console . log ( `Successfully uploaded image to ${ data . url } ` ) ;
92- } else {
93- console . error ( `Something went wrong:` , error ) ;
94- }
95- } ;
96-
97- return (
98- < div >
99- < Label htmlFor = "image-upload" > Upload Image</ Label >
100- < Input
101- id = "image-upload"
102- type = "file"
103- accept = "image/*"
104- onChange = { handleFileChange }
105- />
106- < Button onClick = { uploadImage } > Upload Image</ Button >
107- </ div >
108- ) ;
109- }
You can’t perform that action at this time.
0 commit comments