Skip to content

Commit 9eba47f

Browse files
committed
fix(dashboard): delete dataset, docs
1 parent 7b694d1 commit 9eba47f

8 files changed

Lines changed: 31 additions & 335 deletions

File tree

dashboard/components/DatasetList.tsx

Lines changed: 26 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -107,29 +107,33 @@ function DeleteDatasetModal({ userId, datasetId, open, setOpen }) {
107107
const supabase = useSupabaseClient()
108108

109109
const onHandleDelete = async () => {
110-
const { error: datasetsError } = await supabase
111-
.from('datasets')
112-
.delete()
113-
.eq('owner', userId)
114-
.eq('name', datasetId)
115-
if (datasetsError) {
116-
console.error(datasetsError)
117-
toast.error('😭 Could not delete dataset')
110+
111+
const p = new Promise(async (resolve, reject) => {
112+
const { error: documentsError } = await supabase
113+
.from('documents')
114+
.delete()
115+
.eq('user_id', userId)
116+
.eq('dataset_id', datasetId)
117+
if (documentsError) {
118+
throw new Error('Could not delete dataset' + documentsError)
119+
}
120+
121+
const { error: datasetsError } = await supabase
122+
.from('datasets')
123+
.delete()
124+
.eq('owner', userId)
125+
.eq('name', datasetId)
126+
if (datasetsError) {
127+
throw new Error('Could not delete dataset' + datasetsError)
128+
}
118129
setOpen(undefined)
119-
return
120-
}
121-
const { error: documentsError } = await supabase
122-
.from('documents')
123-
.delete()
124-
.eq('user_id', userId)
125-
.eq('dataset_id', datasetId)
126-
if (documentsError) {
127-
console.error(documentsError)
128-
toast.error('😭 Could not delete dataset')
129-
} else {
130-
toast.success('🎉 Dataset deleted, refresh to see changes')
131-
}
132-
setOpen(undefined)
130+
resolve(null)
131+
})
132+
toast.promise(p, {
133+
loading: 'Deleting...',
134+
success: <b>🎉 Dataset deleted, refresh to see changes!</b>,
135+
error: <b>😭 Could not delete dataset</b>,
136+
}).finally(() => setOpen(undefined)).catch(console.error)
133137
}
134138

135139
const cancelButtonRef = useRef(null)

docs/pages/how-it-works.mdx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,3 @@ Embeddings are a tool that can be used to solve a wide variety of problems. Belo
2828
## Usage
2929

3030
- [Javascript SDK](./sdk)
31-
- [Self-Hosting](./self-hosting/deployment)

docs/pages/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Embedbase is a single API to access both LLMs and a VectorDB\*
77

88
## Key features
99

10-
- Generate: use `.generate()` to use 6+ LLMs
10+
- Generate: use `.generateText()` to use 5+ LLMs
1111
- Semantic Search: use `.add()` to create a list of semantically searchable information and `.search()` to run semantic queries
1212

1313
### Quickstart

docs/pages/sdk.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -567,7 +567,7 @@ console.log(data)
567567
[
568568
"Embedbase API allows to store unstructured data...",
569569
"Embedbase API has 3 main functions a) provides a plug and play solution to store embeddings b) makes it easy to connect to get the right data into llms c)..",
570-
"Embedabase API is self-hostable...",
570+
"Embedabase API let you use hundreds of llms with a unified api...",
571571
]
572572
```
573573
</Tab>
@@ -580,7 +580,7 @@ print(data)
580580
# [
581581
# "Embedbase API allows to store unstructured data...",
582582
# "Embedbase API has 3 main functions a) provides a plug and play solution to store embeddings b) makes it easy to connect to get the right data into llms c)..",
583-
# "Embedabase API is self-hostable...",
583+
# "Embedabase API let you use hundreds of llms with a unified api...",
584584
# ]
585585
```
586586
</Tab>

docs/pages/self-hosting.mdx

Lines changed: 0 additions & 6 deletions
This file was deleted.

docs/pages/tutorials/connect-notion-to-embedbase-with-zapier.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ The magic here is that Embedbase automatically find the right information to pro
139139

140140
That's it for today, you just learned how to use Zapier to connect any data source to Embedbase.
141141

142-
If you liked this blog post, leave a star ⭐️ on https://github.com/different-ai/embedbase, we are also eager for feedback ❤️. If you want to self-host it, please [book a demo](https://cal.com/potato/20min) 😁.
142+
If you liked this blog post, leave a star ⭐️ on https://github.com/different-ai/embedbase, we are also eager for feedback ❤️.
143143
Please feel free to contact us for any help or join the [Embedbase Discord](https://discord.gg/pMNeuGrDky) if you have any questions.
144144

145145
## Where to go from here

docs/pages/tutorials/nextra-qa-docs.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,7 @@ In summary, we have:
539539

540540
Thank you for reading this document, there is an open-source template to create this type of documentation [here](https://github.com/different-ai/embedbase-nextra-docs-template).
541541

542-
If you liked this blog post, leave a star ⭐️ on https://github.com/different-ai/embedbase, we are also eager for feedback ❤️. If you want to self-host it, please [book a demo](https://cal.com/potato/20min) 😁.
542+
If you liked this blog post, leave a star ⭐️ on https://github.com/different-ai/embedbase, we are also eager for feedback ❤️.
543543
Please feel free to contact us for any help!
544544

545545
## Further reading

0 commit comments

Comments
 (0)