-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from MARU-EGG/revert-15-revert-13-chat-form-co…
…mponent Revert "[USER] Feat: chat-form component axios setting"
- Loading branch information
Showing
38 changed files
with
114 additions
and
843 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
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,21 @@ | ||
import { server_axiosInstance } from '../utils/axios'; | ||
|
||
export async function postQuestion(category: string, type: string, content: string): Promise<any> { | ||
const data = { | ||
type, | ||
category, | ||
content, | ||
}; | ||
try { | ||
const response = await server_axiosInstance.post('/api/questions', JSON.stringify(data), { | ||
headers: { | ||
'Content-Type': 'application/json', | ||
}, | ||
}); | ||
console.log('upload success', response.data); | ||
return response.data; | ||
} catch (error: any) { | ||
console.error('Upload Error', error); | ||
throw new Error(`Upload failed: ${error.message}`); | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.