New logs path

pull/772/head
Rick Carlino 2018-04-03 16:49:21 -05:00
parent 2589d144b2
commit 1c32a7b315
5 changed files with 9 additions and 8 deletions

View File

@ -28,10 +28,10 @@ FarmBot::Application.routes.draw do
web_app_config: [:destroy, :show, :update],
}.to_a.map{|(name, only)| resource name, only: only}
resources :points, except: [] do post :search, on: :collection end
resources(:points, except: []) { post :search, on: :collection }
resources :logs, except: [:update, :show] do
post :search, on: :collection
get :search, on: :collection
end
resource :users, except: [:index] do

View File

@ -246,7 +246,7 @@ describe Api::LogsController do
info_log: 3,
fun_log: 3,
debug_log: 3)
post :search
get :search
expect(response.status).to eq(200)
expect(json.length).to eq(examples.length)
end
@ -267,7 +267,7 @@ describe Api::LogsController do
info_log: 0,
fun_log: 0,
debug_log: 0)
post :search
get :search
expect(response.status).to eq(200)
expect(json.length).to eq(0)
end

View File

@ -112,8 +112,9 @@ export class API {
get pointsPath() { return `${this.baseUrl}/api/points/`; }
/** /api/points/search */
get pointSearchPath() { return `${this.pointsPath}/search/`; }
/** /api/logs */
get logsPath() { return `${this.baseUrl}/api/logs/`; }
/** Rather than returning ALL logs, returns a filtered subset.
* /api/logs/search */
get filteredLogsPath() { return `${this.baseUrl}/api/logs/`; }
/** /api/webcam_feed */
get webcamFeedPath() { return `${this.baseUrl}/api/webcam_feeds/`; }
/** /api/web_app_config */

View File

@ -218,7 +218,7 @@ export function urlFor(tag: ResourceName) {
User: API.current.usersPath,
Device: API.current.devicePath,
Image: API.current.imagesPath,
Log: API.current.logsPath,
Log: API.current.filteredLogsPath,
WebcamFeed: API.current.webcamFeedPath,
FbosConfig: API.current.fbosConfigPath,
WebAppConfig: API.current.webAppConfigPath,

View File

@ -47,7 +47,7 @@ export function fetchSyncData(dispatch: Function) {
fetch<FirmwareConfig>("FirmwareConfig", API.current.firmwareConfigPath);
fetch<FarmEvent[]>("FarmEvent", API.current.farmEventsPath);
fetch<Image[]>("Image", API.current.imagesPath);
fetch<Log[]>("Log", API.current.logsPath);
fetch<Log[]>("Log", API.current.filteredLogsPath);
fetch<Peripheral[]>("Peripheral", API.current.peripheralsPath);
fetch<Point[]>("Point", API.current.pointsPath);
fetch<Regimen[]>("Regimen", API.current.regimensPath);