Skip to content

Commit

Permalink
change returned error from selectInterChart
Browse files Browse the repository at this point in the history
  • Loading branch information
IGSON2 committed May 27, 2024
1 parent f2dae85 commit e349c64
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions backend/api/intermediate_chart.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func (s *Server) getImdChart(c *fiber.Ctx) error {
anotherCdd, err := s.selectInterChart(info, it, req.MinTimestamp, req.MaxTimestamp, c.Context())
if err != nil {
if err != sql.ErrNoRows {
s.logger.Error().Str("name", info.Name).Str("interval", it).Int64("min", req.MinTimestamp).Int64("max", req.MaxTimestamp).Msg("cannot select intermediate chart to reference timestamp.")
s.logger.Error().Str("name", info.Name).Str("interval", it).Int64("min", req.MinTimestamp).Int64("max", req.MaxTimestamp).Msg("cannot select intermediate chart of other intervals to reference timestamp.")
return c.Status(fiber.StatusInternalServerError).SendString("cannot make intermediate another chart to reference timestamp.")
}
}
Expand All @@ -81,7 +81,7 @@ func (s *Server) getImdChart(c *fiber.Ctx) error {
)

// 작은단위로
if oc, ok := anotherIntvMap[req.CurInterval]; !ok || oc.PData == nil {
if oc, ok := anotherIntvMap[req.CurInterval]; !ok || oc == nil {
resultCdd = cdd
} else {
// 큰 단위에서 작은단위로 요청하여 현재의 큰 단위의 새로운 캔들이 없는 경우
Expand Down
4 changes: 2 additions & 2 deletions backend/api/intermediate_chart_maker.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
db "bitmoi/backend/db/sqlc"
"bitmoi/backend/utilities"
"context"
"errors"
"database/sql"
)

func (s *Server) selectInterChart(info *utilities.IdentificationData, interval string, minTime, maxTime int64, ctx context.Context) (*CandleData, error) {
Expand Down Expand Up @@ -46,7 +46,7 @@ func (s *Server) selectInterChart(info *utilities.IdentificationData, interval s
}
if cdd.PData == nil || cdd.VData == nil {
s.logger.Debug().Str("name", info.Name).Str("interval", interval).Int64("min", minTime).Int64("max", maxTime).Msg("No intermediate chart data.")
return nil, errors.New("no chart data")
return nil, sql.ErrNoRows
}

return cdd, nil
Expand Down
2 changes: 1 addition & 1 deletion backend/api/middleware.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ func adminAuthMiddleware(adminID string, maker *token.PasetoMaker) fiber.Handler

func createNewOriginMiddleware() fiber.Handler {
return cors.New(cors.Config{
AllowOrigins: "https://bitmoi.co.kr, https://m.bitmoi.co.kr, http://localhost:3000, http://43.203.0.36:3000, http://m.bitmoi.co.kr:444",
AllowOrigins: "https://bitmoi.co.kr, https://m.bitmoi.co.kr, http://localhost:3000, http://m.bitmoi.co.kr:*",
})
}

Expand Down
4 changes: 2 additions & 2 deletions frontend/src/component/tradingBoard/TradingBoard.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,12 @@ function TradingBoard({ modeHeight, mode, score_id, setIsLoaded }) {
if (mode === "competition") {
if (isLogined) {
response = await axiosClient.get(
`/basic/competition?names=${titleArray.join(",")}`
`/auth/competition?names=${titleArray.join(",")}`
);
if (response.status === HttpStatusCode.Unauthorized) {
await checkAccessTokenValidity();
response = await axiosClient.get(
`/basic/competition?names=${titleArray.join(",")}`
`/auth/competition?names=${titleArray.join(",")}`
);
}
} else {
Expand Down

0 comments on commit e349c64

Please sign in to comment.