Skip to content

Commit

Permalink
Fix/#68: 공지사항 새로고침 버그 수정
Browse files Browse the repository at this point in the history
세션스토리지 사용
  • Loading branch information
yh-project committed Nov 16, 2023
1 parent feb3805 commit 5d9e233
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/pages/Notice/utils/useNotice.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@ export const useNotice = function () {
const adminInfo = useRecoilValue(adminAtom); // 관리자 정보
const alert = useAlert(); // alert 제어
const [info, setInfo] = useRecoilState(noticeInfoSelector); // 공지사항 관리 데이터 관리
const admin = JSON.parse(window.sessionStorage.getItem("adminInfo"));

// controller
const nu = {};

// 공지사항 리스트 조회
nu.getNoticeList = function () {
getNoticeList(adminInfo.province, adminInfo.branchName)
getNoticeList(admin.province, admin.branchName)
.then((response) => {
console.log("공지사항 / 조회 : ", response.data);
const tmp = [...response.data];
Expand Down Expand Up @@ -52,7 +53,7 @@ export const useNotice = function () {
};
// 공지사항 검색
nu.searchNotices = function (title) {
getNoticeList(adminInfo.province, adminInfo.branchName)
getNoticeList(admin.province, admin.branchName)
.then((response) => {
console.log("검색 / 조회 : ", response.data);
const tmp = [];
Expand All @@ -74,7 +75,7 @@ export const useNotice = function () {
deleteNotice("first_admin", noticeId)
.then((response) => {
console.log("공지 / 삭제 : ", response.data);
this.getNoticeList(adminInfo.province, adminInfo.branchName);
this.getNoticeList(admin.province, admin.branchName);
})
.catch((error) => console.log("공지 / 삭제에러 : ", error.response));
};
Expand Down

0 comments on commit 5d9e233

Please sign in to comment.