Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(cursus): Access-Control-Allow-Origin 설정 #790

Merged
merged 1 commit into from
Oct 25, 2023

Conversation

nyj001012
Copy link
Contributor

개요

프론트(42library.kr)에서 42 API에 요청을 보낼 때, 데이터를 백엔드에서(/api/cursus/recommend/book) 응답받으려 할 때 나타나는 504 에러 수정

작업 사항

axios로 42 API와 통신 시, 헤더에 AccessControlAllowOriginAccessControllAllowCredentials 옵션 추가

@nyj001012 nyj001012 added the bug Something isn't working label Oct 25, 2023
@nyj001012 nyj001012 self-assigned this Oct 25, 2023
@nyj001012 nyj001012 linked an issue Oct 25, 2023 that may be closed by this pull request
@nyj001012 nyj001012 merged commit d7bca34 into develop Oct 25, 2023
5 checks passed
@jimin52 jimin52 deleted the 789-추천-도서-504-에러 branch October 26, 2023 23:58
nyj001012 added a commit that referenced this pull request Jan 28, 2024
* ci: 타입오류 메시지 상대경로 명시적으로 해소 (#643)

참고: actions/runner#659

* feat: v2 book api (#746)

* refactor: v1 api와 다른 부분 수정

* refactor: books API schema default sort value 추가 및 callSign 오타 수정

* refactor: status: zod.enum -> zod.nativeEnum 변경

z.enum으로 했을때 number 반환값에 대한 처리가 되지 않아 enumStatus 생성 후 nativeEnum으로 변경하였습니다.

* feat: books//:id v2 구현

* feat: books/search v2 구현

* feat: book/update v2 구현

* feat: books/info/:id v2 구현

* refactor: BookNotFoundError import 오타 수정

* feat: books/info/sorted v2 구현

* feat: books/info/tag v2 구현

book_info.id 로 distinct가 되지 않는 오류가 있어요

* refactor: 의미에 맞는 변수명으로 수정 및 코드 간략화

Co-authored-by: scarf <[email protected]>

* refactor: book_info 중복 select 부분 처리

Co-authored-by: scarf <[email protected]>

* feat: books/donator v2 구현

v1 구현 시 얘기했었던 기부자가 유저가 아니더라도 수정될 수 있도록 수정 & email은 더이상 관리하지 않기 때문에 변수명에서 제거

* refactor: 대출 가능 여부 boolean 반환값으로 수정

kysely 사용중 select가 없을 경우 sql syntax 에러로 해당 부분 수정 및 boolean 값 반환되도록 수정

* feat: [get] books/create v2 구현

axios.get 동작 중 발생하는 에러(catch 영역)에 대한 처리를 어떻게 해야할지 모르겠어요

* fix: 임시로 타입 오류 무시

---------

Co-authored-by: scarf <[email protected]>

* style: prettier 적용 (#761)

* build: prettier 설정

* style: prettier 적용

---------

Co-authored-by: nocontribute <>

* [fix] backend dockerfile error (#764)

Co-authored-by: kylee <[email protected]>

* fix: `positiveInt` -> `nonNegativeInt` (#766)

* refactor: v2 라우트 정리 적용 (#771)

* refactor: `/stock` 제거

#767 (comment)

* refactor: contracts에서 500번대 오류 제거

백엔드에서 복구 불가능한 오류일 시 반환하기 때문에, 프론트엔드에서 따로 처리하는 것이 좋을 것 같습니다.

* refactor: `/history` -> `/lendings`

#767 (comment)

Co-authored-by: jwoo <[email protected]>

* refactor: `/users ` 정리

#767 (comment)

Co-authored-by: honeyl3ee <[email protected]>

* refactor: `/tag` 서비스 임시 제거

고도화를 하기 위해서는 내부 구현을 바꾸어야 하는 문제가 있어 우선순위를 낮추었습니다.

주석처리를 할까 고민했으나 제거 이전 커밋(1565441)으로 체크아웃시 전체 코드를 확인 가능하기 때문에 복잡도 감소를 위해 코드를 제거하였습니다.

* refactor: `/books` 경로 정리

#767 (comment)
#767 (comment)

Co-authored-by: Jeong Jihwan <[email protected]>
Co-authored-by: jwoo <[email protected]>

* feat: swagger에서 1줄 요약 표시

---------

Co-authored-by: jwoo <[email protected]>
Co-authored-by: honeyl3ee <[email protected]>
Co-authored-by: Jeong Jihwan <[email protected]>

* feat: add mydata service

토큰에서 id 정보 찾아서 유저 정보 반환하는 controller

* feat: 유저 search 할 때 id 가 undefined  인 경우 핸들링

* feat: add swagger && /me endpoint && apply authValidate

* fix: searchUsersById 타입을 이전과 같이 리턴하도록 변경

searchUsersById 서비스 함수의 종속성이 생각보다 많음.controller 에서 items 의 length 를 확인하도록

* fix: add librarian validate in search endpoint

* feat: 로그인한 유저만 본인 정보를 찾을 수 있도록 middleware 에서 권한 체크

* chore: console.log 제거

* User API 경로 정리 (#777)

* refactor: 400번대 에러 반환 제거

* refactor: overDueDay 반환 값에서 제거

* fix(cursus): Access-Control-Allow-Origin 설정 (#790)

* chore: dependencies 업데이트 (#796)

* chore(deps): contracts의 pnpm-lock 업데이트

* chore(deps): @mapbox/npm-pre-gyp 설치

* chore(deps): npm-pre-gyp 설치

* Revert "chore(deps): npm-pre-gyp 설치"

This reverts commit 8922c38

* chore(deps): package.json과 pnpm-lock.yaml 동기화

* fix: users/me 유저권한 all 로 변경

* fix: 반납 3일 전 알림이 여러 번 전송됨 (#801)

* fix(notification): 3일 전 반납 알림을 중복 사용한 부분 삭제

- 3일 전 반납 알림을 보내는 함수가 notifyReturningReminder(), notifyOverdueManager() 인데, 후자가 유연한 동작을 지원하므로 전자 함수의 동작을 제거함

* fix(notification): 슬랙 연체 알림 보내는 함수 스케줄러에 추가

* Update backend/src/v1/notifications/notifications.service.ts

Co-authored-by: Ji-Hyuck, Min <[email protected]>

* refactor: console.log 제거

---------

Co-authored-by: Ji-Hyuck, Min <[email protected]>

* fix: `dev/v2` 경로 복구 (#808)

* security: 보안 취약점 해결 (#818)

* feat(utils): rate limit 모듈 추가

- R, CUD에 해당하는 rate limit 모듈 추가

* refactor(cursus): rate limit 모듈 import해서 사용하도록 변경

* feat: getRateLimiter 적용

* feat(books): 유효한 ISBN인지 검사하는 로직 추가

* feat(tags): tags router에 rate limit 추가

* feat(routes): router에서 authValidate를 미들웨어로 쓰는 곳에 rate limiter 추가

* feat(auth): /get/me에 rate limiter 추가

* feat(users): 유저 생성 후 created 문장 출력 시, db에 저장된 email 값을 사용

* build: csrf 방지를 위한 lusca 패키지 추가

* feat(app): csrf 방지 로직 추가

* feat(app): csrf 방지 옵션 수정

* build: express-session 패키지 추가

* feat(app): lusca 상태 유지를 위한 세션 추가

* feat(app): cookie에도 secret 추가

* feat(app): session에서 cookie 설정 및 lusca에서 부가적인 설정 제거

* fix(auth): /get/me시, id가 null이면 400 status code 반환 (#816)

- /get/me 시, id가 null이면 400 status code, errorCode.NO_USER 반환
- catch 로직 수정

---------

Co-authored-by: scarf <[email protected]>
Co-authored-by: Jeong Jihwan <[email protected]>
Co-authored-by: gilee <[email protected]>
Co-authored-by: kylee <[email protected]>
Co-authored-by: jwoo <[email protected]>
Co-authored-by: honeyl3ee <[email protected]>
Co-authored-by: jimin <[email protected]>
Co-authored-by: Ji-Hyuck, Min <[email protected]>
nyj001012 added a commit that referenced this pull request Mar 2, 2024
* ci: 타입오류 메시지 상대경로 명시적으로 해소 (#643)

참고: actions/runner#659

* feat: v2 book api (#746)

* refactor: v1 api와 다른 부분 수정

* refactor: books API schema default sort value 추가 및 callSign 오타 수정

* refactor: status: zod.enum -> zod.nativeEnum 변경

z.enum으로 했을때 number 반환값에 대한 처리가 되지 않아 enumStatus 생성 후 nativeEnum으로 변경하였습니다.

* feat: books//:id v2 구현

* feat: books/search v2 구현

* feat: book/update v2 구현

* feat: books/info/:id v2 구현

* refactor: BookNotFoundError import 오타 수정

* feat: books/info/sorted v2 구현

* feat: books/info/tag v2 구현

book_info.id 로 distinct가 되지 않는 오류가 있어요

* refactor: 의미에 맞는 변수명으로 수정 및 코드 간략화

Co-authored-by: scarf <[email protected]>

* refactor: book_info 중복 select 부분 처리

Co-authored-by: scarf <[email protected]>

* feat: books/donator v2 구현

v1 구현 시 얘기했었던 기부자가 유저가 아니더라도 수정될 수 있도록 수정 & email은 더이상 관리하지 않기 때문에 변수명에서 제거

* refactor: 대출 가능 여부 boolean 반환값으로 수정

kysely 사용중 select가 없을 경우 sql syntax 에러로 해당 부분 수정 및 boolean 값 반환되도록 수정

* feat: [get] books/create v2 구현

axios.get 동작 중 발생하는 에러(catch 영역)에 대한 처리를 어떻게 해야할지 모르겠어요

* fix: 임시로 타입 오류 무시

---------

Co-authored-by: scarf <[email protected]>

* style: prettier 적용 (#761)

* build: prettier 설정

* style: prettier 적용

---------

Co-authored-by: nocontribute <>

* [fix] backend dockerfile error (#764)

Co-authored-by: kylee <[email protected]>

* fix: `positiveInt` -> `nonNegativeInt` (#766)

* refactor: v2 라우트 정리 적용 (#771)

* refactor: `/stock` 제거

#767 (comment)

* refactor: contracts에서 500번대 오류 제거

백엔드에서 복구 불가능한 오류일 시 반환하기 때문에, 프론트엔드에서 따로 처리하는 것이 좋을 것 같습니다.

* refactor: `/history` -> `/lendings`

#767 (comment)

Co-authored-by: jwoo <[email protected]>

* refactor: `/users ` 정리

#767 (comment)

Co-authored-by: honeyl3ee <[email protected]>

* refactor: `/tag` 서비스 임시 제거

고도화를 하기 위해서는 내부 구현을 바꾸어야 하는 문제가 있어 우선순위를 낮추었습니다.

주석처리를 할까 고민했으나 제거 이전 커밋(1565441)으로 체크아웃시 전체 코드를 확인 가능하기 때문에 복잡도 감소를 위해 코드를 제거하였습니다.

* refactor: `/books` 경로 정리

#767 (comment)
#767 (comment)

Co-authored-by: Jeong Jihwan <[email protected]>
Co-authored-by: jwoo <[email protected]>

* feat: swagger에서 1줄 요약 표시

---------

Co-authored-by: jwoo <[email protected]>
Co-authored-by: honeyl3ee <[email protected]>
Co-authored-by: Jeong Jihwan <[email protected]>

* feat: add mydata service

토큰에서 id 정보 찾아서 유저 정보 반환하는 controller

* feat: 유저 search 할 때 id 가 undefined  인 경우 핸들링

* feat: add swagger && /me endpoint && apply authValidate

* fix: searchUsersById 타입을 이전과 같이 리턴하도록 변경

searchUsersById 서비스 함수의 종속성이 생각보다 많음.controller 에서 items 의 length 를 확인하도록

* fix: add librarian validate in search endpoint

* feat: 로그인한 유저만 본인 정보를 찾을 수 있도록 middleware 에서 권한 체크

* chore: console.log 제거

* User API 경로 정리 (#777)

* refactor: 400번대 에러 반환 제거

* refactor: overDueDay 반환 값에서 제거

* fix(cursus): Access-Control-Allow-Origin 설정 (#790)

* chore: dependencies 업데이트 (#796)

* chore(deps): contracts의 pnpm-lock 업데이트

* chore(deps): @mapbox/npm-pre-gyp 설치

* chore(deps): npm-pre-gyp 설치

* Revert "chore(deps): npm-pre-gyp 설치"

This reverts commit 8922c38

* chore(deps): package.json과 pnpm-lock.yaml 동기화

* fix: users/me 유저권한 all 로 변경

* fix: 반납 3일 전 알림이 여러 번 전송됨 (#801)

* fix(notification): 3일 전 반납 알림을 중복 사용한 부분 삭제

- 3일 전 반납 알림을 보내는 함수가 notifyReturningReminder(), notifyOverdueManager() 인데, 후자가 유연한 동작을 지원하므로 전자 함수의 동작을 제거함

* fix(notification): 슬랙 연체 알림 보내는 함수 스케줄러에 추가

* Update backend/src/v1/notifications/notifications.service.ts

Co-authored-by: Ji-Hyuck, Min <[email protected]>

* refactor: console.log 제거

---------

Co-authored-by: Ji-Hyuck, Min <[email protected]>

* fix: `dev/v2` 경로 복구 (#808)

* security: 보안 취약점 해결 (#818)

* feat(utils): rate limit 모듈 추가

- R, CUD에 해당하는 rate limit 모듈 추가

* refactor(cursus): rate limit 모듈 import해서 사용하도록 변경

* feat: getRateLimiter 적용

* feat(books): 유효한 ISBN인지 검사하는 로직 추가

* feat(tags): tags router에 rate limit 추가

* feat(routes): router에서 authValidate를 미들웨어로 쓰는 곳에 rate limiter 추가

* feat(auth): /get/me에 rate limiter 추가

* feat(users): 유저 생성 후 created 문장 출력 시, db에 저장된 email 값을 사용

* build: csrf 방지를 위한 lusca 패키지 추가

* feat(app): csrf 방지 로직 추가

* feat(app): csrf 방지 옵션 수정

* build: express-session 패키지 추가

* feat(app): lusca 상태 유지를 위한 세션 추가

* feat(app): cookie에도 secret 추가

* feat(app): session에서 cookie 설정 및 lusca에서 부가적인 설정 제거

* fix(auth): /get/me시, id가 null이면 400 status code 반환 (#816)

- /get/me 시, id가 null이면 400 status code, errorCode.NO_USER 반환
- catch 로직 수정

* fix: 이미지 빌드 에러 수정 (#820)

* feat: 파이썬 가상환경 설치 추가 및 가상환경에서 pip 동작

* feat: server_name 변경 및 루트일 때 인덱스 페이지 지정

* feat: docker-compose에서 443 포트 개방 및 letsencrypt 자동화 스크립트 추가

* feat: scripts/letsencrypt.sh 볼륨 연결

* fix: lusca 설정 수정

* chore: 불필요한 command 제거

* feat(letsencrypt 볼륨 연결):

* chore: lusca 제거

* fix(users): search에서 authvalidate의 roleset을 service로 변경

---------

Co-authored-by: scarf <[email protected]>
Co-authored-by: Jeong Jihwan <[email protected]>
Co-authored-by: gilee <[email protected]>
Co-authored-by: kylee <[email protected]>
Co-authored-by: jwoo <[email protected]>
Co-authored-by: honeyl3ee <[email protected]>
Co-authored-by: jimin <[email protected]>
Co-authored-by: Ji-Hyuck, Min <[email protected]>
nyj001012 added a commit that referenced this pull request Apr 27, 2024
* ci: 타입오류 메시지 상대경로 명시적으로 해소 (#643)

참고: actions/runner#659

* feat: v2 book api (#746)

* refactor: v1 api와 다른 부분 수정

* refactor: books API schema default sort value 추가 및 callSign 오타 수정

* refactor: status: zod.enum -> zod.nativeEnum 변경

z.enum으로 했을때 number 반환값에 대한 처리가 되지 않아 enumStatus 생성 후 nativeEnum으로 변경하였습니다.

* feat: books//:id v2 구현

* feat: books/search v2 구현

* feat: book/update v2 구현

* feat: books/info/:id v2 구현

* refactor: BookNotFoundError import 오타 수정

* feat: books/info/sorted v2 구현

* feat: books/info/tag v2 구현

book_info.id 로 distinct가 되지 않는 오류가 있어요

* refactor: 의미에 맞는 변수명으로 수정 및 코드 간략화

Co-authored-by: scarf <[email protected]>

* refactor: book_info 중복 select 부분 처리

Co-authored-by: scarf <[email protected]>

* feat: books/donator v2 구현

v1 구현 시 얘기했었던 기부자가 유저가 아니더라도 수정될 수 있도록 수정 & email은 더이상 관리하지 않기 때문에 변수명에서 제거

* refactor: 대출 가능 여부 boolean 반환값으로 수정

kysely 사용중 select가 없을 경우 sql syntax 에러로 해당 부분 수정 및 boolean 값 반환되도록 수정

* feat: [get] books/create v2 구현

axios.get 동작 중 발생하는 에러(catch 영역)에 대한 처리를 어떻게 해야할지 모르겠어요

* fix: 임시로 타입 오류 무시

---------

Co-authored-by: scarf <[email protected]>

* style: prettier 적용 (#761)

* build: prettier 설정

* style: prettier 적용

---------

Co-authored-by: nocontribute <>

* [fix] backend dockerfile error (#764)

Co-authored-by: kylee <[email protected]>

* fix: `positiveInt` -> `nonNegativeInt` (#766)

* refactor: v2 라우트 정리 적용 (#771)

* refactor: `/stock` 제거

#767 (comment)

* refactor: contracts에서 500번대 오류 제거

백엔드에서 복구 불가능한 오류일 시 반환하기 때문에, 프론트엔드에서 따로 처리하는 것이 좋을 것 같습니다.

* refactor: `/history` -> `/lendings`

#767 (comment)

Co-authored-by: jwoo <[email protected]>

* refactor: `/users ` 정리

#767 (comment)

Co-authored-by: honeyl3ee <[email protected]>

* refactor: `/tag` 서비스 임시 제거

고도화를 하기 위해서는 내부 구현을 바꾸어야 하는 문제가 있어 우선순위를 낮추었습니다.

주석처리를 할까 고민했으나 제거 이전 커밋(1565441)으로 체크아웃시 전체 코드를 확인 가능하기 때문에 복잡도 감소를 위해 코드를 제거하였습니다.

* refactor: `/books` 경로 정리

#767 (comment)
#767 (comment)

Co-authored-by: Jeong Jihwan <[email protected]>
Co-authored-by: jwoo <[email protected]>

* feat: swagger에서 1줄 요약 표시

---------

Co-authored-by: jwoo <[email protected]>
Co-authored-by: honeyl3ee <[email protected]>
Co-authored-by: Jeong Jihwan <[email protected]>

* feat: add mydata service

토큰에서 id 정보 찾아서 유저 정보 반환하는 controller

* feat: 유저 search 할 때 id 가 undefined  인 경우 핸들링

* feat: add swagger && /me endpoint && apply authValidate

* fix: searchUsersById 타입을 이전과 같이 리턴하도록 변경

searchUsersById 서비스 함수의 종속성이 생각보다 많음.controller 에서 items 의 length 를 확인하도록

* fix: add librarian validate in search endpoint

* feat: 로그인한 유저만 본인 정보를 찾을 수 있도록 middleware 에서 권한 체크

* chore: console.log 제거

* User API 경로 정리 (#777)

* refactor: 400번대 에러 반환 제거

* refactor: overDueDay 반환 값에서 제거

* fix(cursus): Access-Control-Allow-Origin 설정 (#790)

* chore: dependencies 업데이트 (#796)

* chore(deps): contracts의 pnpm-lock 업데이트

* chore(deps): @mapbox/npm-pre-gyp 설치

* chore(deps): npm-pre-gyp 설치

* Revert "chore(deps): npm-pre-gyp 설치"

This reverts commit 8922c38

* chore(deps): package.json과 pnpm-lock.yaml 동기화

* fix: users/me 유저권한 all 로 변경

* fix: 반납 3일 전 알림이 여러 번 전송됨 (#801)

* fix(notification): 3일 전 반납 알림을 중복 사용한 부분 삭제

- 3일 전 반납 알림을 보내는 함수가 notifyReturningReminder(), notifyOverdueManager() 인데, 후자가 유연한 동작을 지원하므로 전자 함수의 동작을 제거함

* fix(notification): 슬랙 연체 알림 보내는 함수 스케줄러에 추가

* Update backend/src/v1/notifications/notifications.service.ts

Co-authored-by: Ji-Hyuck, Min <[email protected]>

* refactor: console.log 제거

---------

Co-authored-by: Ji-Hyuck, Min <[email protected]>

* fix: `dev/v2` 경로 복구 (#808)

* security: 보안 취약점 해결 (#818)

* feat(utils): rate limit 모듈 추가

- R, CUD에 해당하는 rate limit 모듈 추가

* refactor(cursus): rate limit 모듈 import해서 사용하도록 변경

* feat: getRateLimiter 적용

* feat(books): 유효한 ISBN인지 검사하는 로직 추가

* feat(tags): tags router에 rate limit 추가

* feat(routes): router에서 authValidate를 미들웨어로 쓰는 곳에 rate limiter 추가

* feat(auth): /get/me에 rate limiter 추가

* feat(users): 유저 생성 후 created 문장 출력 시, db에 저장된 email 값을 사용

* build: csrf 방지를 위한 lusca 패키지 추가

* feat(app): csrf 방지 로직 추가

* feat(app): csrf 방지 옵션 수정

* build: express-session 패키지 추가

* feat(app): lusca 상태 유지를 위한 세션 추가

* feat(app): cookie에도 secret 추가

* feat(app): session에서 cookie 설정 및 lusca에서 부가적인 설정 제거

* fix(auth): /get/me시, id가 null이면 400 status code 반환 (#816)

- /get/me 시, id가 null이면 400 status code, errorCode.NO_USER 반환
- catch 로직 수정

* fix: 이미지 빌드 에러 수정 (#820)

* feat: 파이썬 가상환경 설치 추가 및 가상환경에서 pip 동작

* feat: server_name 변경 및 루트일 때 인덱스 페이지 지정

* feat: docker-compose에서 443 포트 개방 및 letsencrypt 자동화 스크립트 추가

* feat: scripts/letsencrypt.sh 볼륨 연결

* fix: lusca 설정 수정

* chore: 불필요한 command 제거

* feat(letsencrypt 볼륨 연결):

* chore: lusca 제거

* fix(users): search에서 authvalidate의 roleset을 service로 변경

* fix: 스케줄러에 의한 예약 만료 및 재할당 코드 (#814)

* fix: 스케줄러에 의한 예약 만료 및 재할당 코드

scheduler.ts
- midnightScheduler에서 예약만료처리 코드를 삭제했습니다.
- 예약만료처리와 함께 재할당하고, 이에 따른 슬랙메시지를 바로 전송하기 위해 morningScheduler에서 모두 처리합니다.
- 슬랙메시지 전송은 낮이 바람직하고, 일련의 처리를 굳이 새벽과 아침에 나누어 작동해야할 필요성을 크게 느끼지 못했습니다.

notification.service.ts
- notifyReservationOverdue, notifyReservation 코드는 하나로 통합하였습니다. 기존 코드의 역할을 동일하게 수행합니다.
- 쿼리 구현부 코드는 모두 reservations.service.ts 에 새롭게 작성된 함수로 대체하였습니다.
- 쿼리 실행 과정에서 오류 발생시 에러를 던집니다.
- 슬랙 메시지 전송 과정에서 오류 발생시엔 로그만 남깁니다.

reservations.service.ts
- 총 3개의 함수가 추가되었습니다.
- handleReservationOverdueAndAssignReservationToNextWaitingUser는 트랜잭션을 설정하고, 슬랙 메시지 전송을 위해 수행 결과를 반환합니다.
- handleReservationOverdue는 예약 만료 처리를 한 뒤, 해당 예약 정보를 반환합니다.
- assignReservationToNextWaitingUser는 만료된 예약정보를 받아 다음 예약자에게 할당합니다.

handleReservationOverdueAndAssignReservationToNextWaitingUser()
- 예약 만료 처리와 다음 예약자에게 할당하는 것이 하나의 트랜잭션안에서 수행되도록 설정합니다.
- 사이드 이펙트 방지를 위해 로직을 처리하는 동안 lending에 ROCK을 설정합니다.

handleReservationOverdue()
- 기존 코드의 논리적 오류를 수정했습니다.
- 예약 만료 처리해야할 데이터 조회 로직을 수정했습니다. status가 3이 아니라, 0이면서 && 책이 할당되었으면서 && 만료일이 지난 예약을 찾습니다.
- 이제 이곳에서 정상적으로 예약만료 처리과정에서 status = 3을 부여합니다.

assignReservationToNextWaitingUser()
- 기존 코드의 논리적 오류를 수정했습니다.
- handleReservationOverdue()를 통해 예약 만료된 책 정보를 1개씩 입력받습니다.
- 해당 책에 대해서 다음 예약자가 존재하면 할당합니다.

* fix: Promise.allSetteld로 변경

* chore(reservations): reservation_id 대신 reservation.id 사용

* feat(reservations): LOCK 제거

* feat(reservations): SQL문 분리 및 서브쿼리 수정

* feat(reservations): 누락된 트랜잭션 커밋 추가

* chore(reservations): 오타 수정

---------

Co-authored-by: yena <[email protected]>

* cd: nginx 설정 파일에 ssl 설정 추가 (#823)

* feat(nginx): nginx 설정 파일에 ssl 설정 추가

- http, https 디렉티브 분리
- certbot 인증서 설정 추가

* feat: host 비교 조건문 수정

* User API 경로 정리 (#777)

* refactor: 400번대 에러 반환 제거

* refactor: overDueDay 반환 값에서 제거

* Revert "User API 경로 정리 (#777)"

This reverts commit 9adc701.

---------

Co-authored-by: scarf <[email protected]>
Co-authored-by: Jeong Jihwan <[email protected]>
Co-authored-by: gilee <[email protected]>
Co-authored-by: kylee <[email protected]>
Co-authored-by: jwoo <[email protected]>
Co-authored-by: honeyl3ee <[email protected]>
Co-authored-by: jimin <[email protected]>
Co-authored-by: Ji-Hyuck, Min <[email protected]>
Co-authored-by: jhj9109 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

추천 도서 504 에러
2 participants