Skip to content

Commit

Permalink
Merge pull request #16 from MARU-EGG/revert-15-revert-13-chat-form-co…
Browse files Browse the repository at this point in the history
…mponent

Revert "[USER] Feat: chat-form component axios setting"
  • Loading branch information
swgvenghy authored Jul 24, 2024
2 parents 46c700e + a4b8b6e commit 5a21c7c
Show file tree
Hide file tree
Showing 38 changed files with 114 additions and 843 deletions.
2 changes: 1 addition & 1 deletion .storybook/main.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { StorybookConfig } from '@storybook/react-webpack5';

const config: StorybookConfig = {
stories: ['../src/ui/**/*.mdx', '../src/ui/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
stories: ['../src/ui/**/*.stories.@(js|jsx|ts|tsx)'],
addons: [
'@storybook/preset-create-react-app',
'@storybook/addon-onboarding',
Expand Down
21 changes: 21 additions & 0 deletions src/api/post-question.ts
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}`);
}
}
4 changes: 2 additions & 2 deletions src/assets/Send.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
52 changes: 0 additions & 52 deletions src/stories/Button.stories.ts

This file was deleted.

48 changes: 0 additions & 48 deletions src/stories/Button.tsx

This file was deleted.

Loading

0 comments on commit 5a21c7c

Please sign in to comment.