Skip to content

Commit

Permalink
Fixed firebase form
Browse files Browse the repository at this point in the history
  • Loading branch information
Tarik Huber authored and Tarik Huber committed Jun 26, 2023
1 parent 38fff11 commit 7ab3a86
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions packages/rmw-shell/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/rmw-shell/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rmw-shell",
"version": "11.2.23",
"version": "11.2.24",
"description": "React template with Material UI, Firebase, routing...",
"main": "lib/index.js",
"module": "es/index.js",
Expand Down
4 changes: 2 additions & 2 deletions packages/rmw-shell/src/containers/FirebaseForm/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Form as FinalForm } from "react-final-form";
import { usePaths } from "../../providers/Firebase/Paths";
import { useAuth } from "base-shell/lib/providers/Auth";
import arrayMutators from "final-form-arrays";
import { getDatabase, ref, push, update } from "firebase/database";
import { getDatabase, ref, push, set, update } from "firebase/database";

const FirebaseForm = ({
uid,
Expand Down Expand Up @@ -45,7 +45,7 @@ const FirebaseForm = ({
console.log("values", values);

if (uid) {
await update(ref(getDatabase(), `${path}/${uid}`), values);
await set(ref(getDatabase(), `${path}/${uid}`), values);
} else {
if (isGranted(auth, grants.create)) {
const snap = await await push(ref(getDatabase(), path), values);
Expand Down

0 comments on commit 7ab3a86

Please sign in to comment.