-
Notifications
You must be signed in to change notification settings - Fork 3
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 #112 from Team-Lecue/feature/CreateNote
Merge Feature/create note into dev
- Loading branch information
Showing
21 changed files
with
730 additions
and
267 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { api } from '../../libs/api'; | ||
|
||
const getPresignedUrl = async () => { | ||
const { data } = await api.get('/api/images/note'); | ||
return data; | ||
}; | ||
|
||
export default getPresignedUrl; |
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,38 @@ | ||
// import { useNavigate } from 'react-router-dom'; | ||
|
||
import { api } from '../../libs/api'; | ||
import { postLecueNoteProps } from '../type/lecueNoteType'; | ||
|
||
const postLecueNote = ({ | ||
contents, | ||
color, | ||
fileName, | ||
bgColor, | ||
}: postLecueNoteProps) => { | ||
// const navigate = useNavigate(); | ||
|
||
const response = api | ||
.post( | ||
'/api/notes', | ||
{ | ||
bookId: 1, | ||
content: contents, | ||
textColor: color, | ||
background: fileName ? fileName : bgColor, | ||
}, | ||
{ | ||
headers: { | ||
Authorization: `Bearer ${import.meta.env.VITE_APP_TOKEN}`, | ||
}, | ||
}, | ||
) | ||
.then((res) => { | ||
console.log(res); | ||
// 나중에 주석코드를 활성화시킬 예정! | ||
// navigate(`lecue-book/${res.data.data.bookUuid}`); | ||
}); | ||
|
||
return response; | ||
}; | ||
|
||
export default postLecueNote; |
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,18 @@ | ||
import { api } from '../../libs/api'; | ||
import { putPresignedUrlProps } from '../type/lecueNoteType'; | ||
|
||
const putPresignedUrl = ({ | ||
presignedUrl, | ||
binaryFile, | ||
fileType, | ||
}: putPresignedUrlProps) => { | ||
const response = api.put(presignedUrl, binaryFile, { | ||
headers: { | ||
'Content-Type': fileType, | ||
}, | ||
}); | ||
|
||
return response; | ||
}; | ||
|
||
export default putPresignedUrl; |
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
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
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
Oops, something went wrong.