Skip to content

Commit

Permalink
feat: #6 add missing files
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianrbp committed Aug 8, 2024
1 parent c52a6eb commit 7b54b7b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
7 changes: 4 additions & 3 deletions backend/app/controllers/concerns/json_response.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@ module JsonResponse

before_action :ensure_json_request
before_action :set_default_format
end

def render_not_found
render json: { error: 'Not Found' }, status: :not_found
def render_not_found
render json: { error: 'Not Found' }, status: :not_found
end

end

private
Expand Down
4 changes: 2 additions & 2 deletions backend/app/views/weeks/index.json.jbuilder
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
json.data do
json.past do
json.array! @weeks_past, partial: "weeks/week", as: :week
json.array! @weeks[:past], partial: "weeks/week", as: :week
end
json.future do
json.array! @weeks_future, partial: "weeks/week", as: :week
json.array! @weeks[:future], partial: "weeks/week", as: :week
end
end

Expand Down
6 changes: 5 additions & 1 deletion frontend/requests/01_company_services.http
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ GET http://rails:3000/company_services HTTP/1.1
Accept: application/json

### 2nd Dropdown - Get Weeks
GET http://rails:3000/company_services/:id/weeks HTTP/1.1
GET http://rails:3000/company_services/1/weeks HTTP/1.1
Accept: application/json


Expand All @@ -24,3 +24,7 @@ Accept: application/json
POST http://rails:3000/company_services/:id/engineers/availability HTTP/1.1
Accept: application/json


### error handling
GET http://rails:3000/abc HTTP/1.1
Accept: application/json

0 comments on commit 7b54b7b

Please sign in to comment.