-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implemented: Gitbook lens search feature #24
Conversation
src/services/UtilService.ts
Outdated
@@ -1,4 +1,5 @@ | |||
import api from "@/api" | |||
import api, {client} from "@/api" | |||
import { hasError } from "@/utils"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove unused imports.
src/services/UtilService.ts
Outdated
const baseURL = `https://api.gitbook.com/v1/spaces/${process.env.VUE_APP_SPACE_ID}/search/` | ||
|
||
return await client({ | ||
url: `ask`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
url: `ask`, | |
url: "ask" |
src/services/UtilService.ts
Outdated
headers: { | ||
Authorization: 'Bearer ' + token, | ||
"Content-Type": "application/json", | ||
"Access-Control-Allow-Origin": "*" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is not required.
src/services/UtilService.ts
Outdated
}) as any; | ||
} | ||
|
||
const getGitboookPage = async (pageId: any): Promise <any> => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const getGitboookPage = async (pageId: any): Promise <any> => { | |
const getGitBookPage = async (pageId: any): Promise <any> => { |
src/services/UtilService.ts
Outdated
|
||
const getGitboookPage = async (pageId: any): Promise <any> => { | ||
const token = process.env.VUE_APP_GITBOOK_API_KEY; | ||
const baseURL = `https://api.gitbook.com/v1/spaces/${process.env.VUE_APP_SPACE_ID}/` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can keep the gitbook api endpoint in the env https://api.gitbook.com/v1/spaces/
const baseURL = `https://api.gitbook.com/v1/spaces/${process.env.VUE_APP_SPACE_ID}/` | |
const baseURL = `https://api.gitbook.com/v1/spaces/${process.env.VUE_APP_SPACE_ID}/` |
src/components/GitBookSearch.vue
Outdated
<ion-toolbar> | ||
<ion-buttons slot="start"> | ||
<ion-button @click="closeModal"> | ||
<ion-icon :icon="close" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add slot icon-only
… gitbook api calls (hotwax#23)
if (token) { | ||
|
||
// TODO: think of better solution to avoid sending api_key for external apis. | ||
if (token && !config.baseURL.includes("gitbook")) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can check for Authorization
field in the config headers, if found we will not add the api_key.
So that it will not be specific to gitbook.
Has implemented this with different approach in following PR : #26 |
Related Issues
Closes #
Short Description and Why It's Useful
Screenshots of Visual Changes before/after (If There Are Any)
Contribution and Currently Important Rules Acceptance