We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dda0af3 commit a8bd450Copy full SHA for a8bd450
src/components/databrowser/hooks/use-add-key.ts
@@ -13,6 +13,8 @@ export const useAddKey = () => {
13
14
const mutation = useMutation({
15
mutationFn: async ({ key, type }: { key: string; type: DataType }) => {
16
+ if (await redis.exists(key)) throw new Error(`Key "${key}" already exists`)
17
+
18
switch (type) {
19
case "set": {
20
await redis.sadd(key, "value")
0 commit comments