Skip to content

Commit

Permalink
Merge pull request #53 from CAU-Capstone-FindIt/develop
Browse files Browse the repository at this point in the history
api 포트번호 수정
  • Loading branch information
kimtree24 authored Dec 5, 2024
2 parents 01b51ac + ef63a3d commit 4ccbef8
Show file tree
Hide file tree
Showing 13 changed files with 26 additions and 26 deletions.
2 changes: 1 addition & 1 deletion src/apis/FindQuery.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export const useFindListQuery = () => {
const initializeFindList = async () => {
try {
const responseFind = await axios.get(
"http://findit.p-e.kr:8080/api/items/found/all"
"https://findit.p-e.kr:8443/api/items/found/all"
);

console.log(responseFind);
Expand Down
2 changes: 1 addition & 1 deletion src/apis/FindSearch.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import axios from "axios";

const baseUrl = "http://findit.p-e.kr:8080";
const baseUrl = "https://findit.p-e.kr:8443";

export const findSearch = async (visionResponse)=>{
try{
Expand Down
2 changes: 1 addition & 1 deletion src/apis/LostQuery.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const useLostListQuery = () => {
const initializeLostList = async () => {
try {
const responseFind = await axios.get(
"http://findit.p-e.kr:8080/api/items/lost/all"
"https://findit.p-e.kr:8443/api/items/lost/all"
);

console.log(responseFind);
Expand Down
2 changes: 1 addition & 1 deletion src/apis/LostSearch.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import axios from "axios";

const baseUrl = "http://findit.p-e.kr:8080";
const baseUrl = "https://findit.p-e.kr:8443";

export const lostSearch = async (visionResponse)=>{
try{
Expand Down
2 changes: 1 addition & 1 deletion src/apis/MyRegister.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import axios from "axios";

const baseUrl = "http://findit.p-e.kr:8080";
const baseUrl = "https://findit.p-e.kr:8443";

const accessToken = localStorage.getItem("access");

Expand Down
6 changes: 3 additions & 3 deletions src/apis/Postapi.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import axios from "axios";
// const postFindItem = async (newItem) => {
// try {
// const response = await axios.post(
// "http://findit.p-e.kr:8080/api/items/found",
// "https://findit.p-e.kr:8443/api/items/found",
// newItem
// );
// return response.data;
Expand Down Expand Up @@ -57,10 +57,10 @@ export const usePostFindItem = () => {
mutationFn: postFindItem,
onSuccess: ({ apiUrl }) => {
// apiUrl에 따라 해당하는 리스트를 재조회
if (apiUrl === "http://findit.p-e.kr:8080/api/items/lost/register") {
if (apiUrl === "https://findit.p-e.kr:8443/api/items/lost/register") {
queryClient.invalidateQueries(["lostlist"]); // findlist 데이터 새로고침
} else if (
apiUrl === "http://findit.p-e.kr:8080/api/items/found/report"
apiUrl === "https://findit.p-e.kr:8443/api/items/found/report"
) {
queryClient.invalidateQueries(["findlist"]); // lostlist 데이터 새로고침
}
Expand Down
2 changes: 1 addition & 1 deletion src/apis/login.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const handleOAuth = async () => {
if (code) {
try {
const result = await axios.post(
"http://findit.p-e.kr:8080/api/users/login",
"https://findit.p-e.kr:8443/api/users/login",
{
code: code,
}
Expand Down
2 changes: 1 addition & 1 deletion src/apis/logout.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export const handleLogout = async () => {
alert('로그아웃 되었습니다.');
window.location.href = "/";
// try {
// await axios.post('http://findit.p-e.kr:8080/api/users/logout', {}, {
// await axios.post('https://findit.p-e.kr:8443/api/users/logout', {}, {
// headers: {
// 'Authorization': `Bearer ${token}`
// }
Expand Down
2 changes: 1 addition & 1 deletion src/apis/messageApi.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import axios from "axios";

const baseUrl = "http://findit.p-e.kr:8080";
const baseUrl = "https://findit.p-e.kr:8443";

const accessToken = localStorage.getItem("access");

Expand Down
2 changes: 1 addition & 1 deletion src/apis/user.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import axios from "axios";

const baseUrl = "http://findit.p-e.kr:8080";
const baseUrl = "https://findit.p-e.kr:8443";

const accessToken = localStorage.getItem("access");

Expand Down
20 changes: 10 additions & 10 deletions src/pages/Comments.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ const Comments = ({ report, pageType }) => {
const fetchComments = async () => {
let url;
if (pageType === "find") {
url = `http://findit.p-e.kr:8080/api/items/found/${report.id}`;
url = `https://findit.p-e.kr:8443/api/items/found/${report.id}`;
} else {
url = `http://findit.p-e.kr:8080/api/items/lost/${report.id}`;
url = `https://findit.p-e.kr:8443/api/items/lost/${report.id}`;
}

try {
Expand Down Expand Up @@ -54,14 +54,14 @@ const Comments = ({ report, pageType }) => {
content: newComment,
parentCommentId: null,
};
url = `http://findit.p-e.kr:8080/api/items/found/comment`;
url = `https://findit.p-e.kr:8443/api/items/found/comment`;
} else {
commentData = {
lostItemId: report.id,
content: newComment,
parentCommentId: null,
};
url = `http://findit.p-e.kr:8080/api/items/lost/comment`;
url = `https://findit.p-e.kr:8443/api/items/lost/comment`;
}

try {
Expand Down Expand Up @@ -103,14 +103,14 @@ const Comments = ({ report, pageType }) => {
content: newReply, // 대댓글 내용
parentCommentId: parentCommentId, // 부모 댓글 ID
};
url = `http://findit.p-e.kr:8080/api/items/found/comment`;
url = `https://findit.p-e.kr:8443/api/items/found/comment`;
} else {
replyData = {
lostItemId: report.id, // 현재 신고된 물품 ID
content: newReply, // 대댓글 내용
parentCommentId: parentCommentId, // 부모 댓글 ID
};
url = `http://findit.p-e.kr:8080/api/items/lost/comment`;
url = `https://findit.p-e.kr:8443/api/items/lost/comment`;
}

try {
Expand Down Expand Up @@ -157,14 +157,14 @@ const Comments = ({ report, pageType }) => {
content: editContent, // 대댓글 내용
parentCommentId: editParentIndex, // 부모 댓글 ID
};
url = `http://findit.p-e.kr:8080/api/items/found/comment/${editIndex}`;
url = `https://findit.p-e.kr:8443/api/items/found/comment/${editIndex}`;
} else {
editData = {
lostItemId: report.id, // 현재 신고된 물품 ID
content: editContent, // 대댓글 내용
parentCommentId: editParentIndex, // 부모 댓글 ID
};
url = `http://findit.p-e.kr:8080/api/items/lost/comment/${editIndex}`;
url = `https://findit.p-e.kr:8443/api/items/lost/comment/${editIndex}`;
}

try {
Expand Down Expand Up @@ -193,9 +193,9 @@ const Comments = ({ report, pageType }) => {
}
let url;
if (pageType === "find") {
url = `http://findit.p-e.kr:8080/api/items/found/comment/${commentId}`;
url = `https://findit.p-e.kr:8443/api/items/found/comment/${commentId}`;
} else {
url = `http://findit.p-e.kr:8080/api/items/lost/comment/${commentId}`;
url = `https://findit.p-e.kr:8443/api/items/lost/comment/${commentId}`;
}

console.log(commentId);
Expand Down
4 changes: 2 additions & 2 deletions src/pages/Detail.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ const Detail = () => {
console.log(accessToken);
try {
const response = await axios.put(
`http://findit.p-e.kr:8080/api/items/found/${report.id}/status`,
`https://findit.p-e.kr:8443/api/items/found/${report.id}/status`,
{
status: "REGISTERED",
},
Expand Down Expand Up @@ -155,7 +155,7 @@ const Detail = () => {
console.log(accessToken);
try {
const response = await axios.put(
`http://findit.p-e.kr:8080/api/items/lost/${report.id}/status`,
`https://findit.p-e.kr:8443/api/items/lost/${report.id}/status`,
{
status: "REGISTERED",
},
Expand Down
4 changes: 2 additions & 2 deletions src/pages/Form.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,8 @@ const Form = () => {
{
apiUrl:
reportInfo.mode === "found"
? "http://findit.p-e.kr:8080/api/items/found/report"
: "http://findit.p-e.kr:8080/api/items/lost/register",
? "https://findit.p-e.kr:8443/api/items/found/report"
: "https://findit.p-e.kr:8443/api/items/lost/register",
data: data, // FormData 객체
},
{
Expand Down

0 comments on commit 4ccbef8

Please sign in to comment.