Skip to content

Commit 950f31c

Browse files
committed
fixes
1 parent 5343234 commit 950f31c

File tree

5 files changed

+14
-13
lines changed

5 files changed

+14
-13
lines changed

docs/docs/botasaurus-desktop/enhancing-scrapers/input-controls.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ A single-select dropdown menu. It requires either an `options` array or a `searc
112112
**Example - Dynamic Options**
113113
```ts
114114
.select("city", {
115-
searchMethod: "getCityOptions", // Backend method that fetches options
115+
searchMethod: "searchCityOptions", // Backend method that fetches options
116116
canCreateOptions: true, // Allow users to create custom options
117117
defaultValue: {value: 'US__CA__SF', label: "San Francisco"},
118118
})
@@ -136,7 +136,7 @@ To use `searchMethod`, you need to define async handler functions and add them u
136136
**Input JS Implementation:**
137137
```ts
138138
.select("city", {
139-
searchMethod: "getCityOptions", // Backend method that fetches options
139+
searchMethod: "searchCityOptions", // Backend method that fetches options
140140
canCreateOptions: true, // Allow users to create custom options
141141
defaultValue: {value: 'US__CA__SF', label: "San Francisco"},
142142
})
@@ -150,7 +150,7 @@ import { config } from '../../main/config';
150150

151151
const baseUrl = config.isDev ? "http://0.0.0.0:3000" : "https://api.my-app.com";
152152

153-
async function getCityOptions(query: string, data: any) {
153+
async function searchCityOptions(query: string, data: any) {
154154
const params = {
155155
query,
156156
};
@@ -165,7 +165,7 @@ async function getCityOptions(query: string, data: any) {
165165

166166
// Register the search endpoint
167167
Server.addSearchOptionsEndpoints({
168-
getCityOptions,
168+
searchCityOptions,
169169
});
170170
```
171171

@@ -193,7 +193,7 @@ A multi-select dropdown menu. It requires either an `options` array or a `search
193193
**Example - Dynamic Search with Bulk Add**
194194
```ts
195195
.multiSelect("cities", {
196-
searchMethod: "getCityOptions", // Backend method that fetches options
196+
searchMethod: "searchCityOptions", // Backend method that fetches options
197197
canCreateOptions: true, // Allow users to create custom options
198198
canBulkAdd: true, // Enable bulk add/edit functionality
199199
defaultValue: [{value: 'US__CA__SF', label: "San Francisco"}],

js/botasaurus-desktop-api/botasaurus-desktop-api-docs/package-lock.json

Lines changed: 4 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/botasaurus-desktop-api/botasaurus-desktop-api-docs/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@
3131
"build": "PUBLIC_URL=https://botasaurus-api.omkar.cloud/ react-scripts build && rm -f ./build/static/js/*.map ./build/asset-manifest.json",
3232
"build-dev": "react-scripts build",
3333
"test": "react-scripts test",
34+
"update": "npm update --legacy-peer-deps botasaurus-controls",
3435
"eject": "react-scripts eject",
35-
"analyze": "source-map-explorer 'build/static/js/*.js'",
36-
"update": "npm update botasaurus-controls"
36+
"analyze": "source-map-explorer 'build/static/js/*.js'"
3737
},
3838
"eslintConfig": {
3939
"extends": [

js/botasaurus-server-js/src/api-config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -966,4 +966,4 @@ class ApiConfig {
966966
this.routeSetupFn = routeSetupFn;
967967
}
968968
}
969-
export default ApiConfig;
969+
export default ApiConfig;

js/botasaurus-server-js/src/routes-db-logic.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ async function performCreateAllTask(
3636
scraper_type: string,
3737
all_task_sort_id: number,
3838
withResult: boolean = true,
39-
splitted_task_length: number = 0
39+
splitted_task_length: number
4040
): Promise<[any, string]> {
41-
const task_name = splitted_task_length ? `All Task (${splitted_task_length} Tasks)` : 'All Task'
41+
const task_name = splitted_task_length > 1 ? `All Task (${splitted_task_length} Tasks)` : 'All Task'
4242

4343
const allTask = new Task({
4444
id: await getAutoincrementId(),

0 commit comments

Comments
 (0)