goodjoblife / GoodJobShare

GoodJob 職場透明化運動
https://www.goodjob.life/
MIT License
82 stars 11 forks source link

refactor: [公司職稱頁面] handling 404 cases #1425

Closed mark86092 closed 2 months ago

mark86092 commented 2 months ago

Close #1418

這個 PR 是?

建立一個 Wrapper,統一用來處理 box 的狀態

我應該如何手動測試?

轉址正常運作

curl -i http://localhost:3000/companies/%E5%8F%B0%E7%A9%8D%E9%9B%BB
HTTP/1.1 301 Moved Permanently
Location: /companies/%E5%8F%B0%E7%81%A3%E7%A9%8D%E9%AB%94%E9%9B%BB%E8%B7%AF%E8%A3%BD%E9%80%A0%E8%82%A1%E4%BB%BD%E6%9C%89%E9%99%90%E5%85%AC%E5%8F%B8

# 同理
curl -i http://localhost:3000/companies/%E5%8F%B0%E7%A9%8D%E9%9B%BB/salary-work-times
curl -i http://localhost:3000/companies/%E5%8F%B0%E7%A9%8D%E9%9B%BB/work-experiences
curl -i http://localhost:3000/companies/%E5%8F%B0%E7%A9%8D%E9%9B%BB/interview-experiences

不存在的公司

curl -i http://localhost:3000/companies/not-exists
HTTP/1.1 404 Not Found

# 同理
curl -i http://localhost:3000/companies/not-exists/salary-work-times
curl -i http://localhost:3000/companies/not-exists/work-experiences
curl -i http://localhost:3000/companies/not-exists/interview-experiences

沒有資料

curl -i http://localhost:3000/companies/AAA/work-experiences
HTTP/1.1 404 Not Found
curl -i "http://localhost:3000/companies/AAA/interview-experiences?p=2"
HTTP/1.1 404 Not Found