-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
radheyshyamjat
committed
Feb 16, 2024
1 parent
3e67069
commit b7f2fb8
Showing
3 changed files
with
94 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
{ | ||
/* Visit https://firebase.google.com/docs/database/security to learn more about security rules. */ | ||
"rules": { | ||
".read": false, | ||
".write": false | ||
".read": true, | ||
".write": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,14 +18,62 @@ export const helloWorld = functions.https.onRequest(async (request, response) => | |
name: "Radhey", | ||
email: "[email protected]", | ||
phone: "8983026208", | ||
tags: ["tagId1", "tagId2", "tagId3"] | ||
}, | ||
kilvishId2: { | ||
kilvishId: "KilvishId2", | ||
name: "dummy Name", | ||
email: "[email protected]", | ||
phone: "8208567820", | ||
}, | ||
}) | ||
}); | ||
|
||
const tagRef = db.ref("tags") | ||
await tagRef.update({ | ||
tagId1: { | ||
owner: "kilvishId1", | ||
name: "Radhey1", | ||
sharedWith: ["kilvishId2"], | ||
expenses: ["expenses1", "expenses2", "expenses3"] | ||
}, | ||
tagId2: { | ||
owner: "kilvishId1", | ||
name: "Radhey2", | ||
sharedWith: ["kilvishId2"], | ||
expenses: ["expenses1", "expenses2", "expenses3"] | ||
}, | ||
tagId3: { | ||
owner: "kilvishId1", | ||
name: "Radhey3", | ||
sharedWith: ["kilvishId2"], | ||
expenses: ["expenses1", "expenses2", "expenses3"] | ||
}, | ||
}); | ||
|
||
const expensesRef = db.ref("expenses") | ||
await expensesRef.update({ | ||
expenses1: { | ||
timestamp: "2024-02-16 00:45:51.571338", | ||
from: "kilvishId1", | ||
to: "kilvishId2", | ||
amount: 200, | ||
tags: ["tag1", "tag2", "tag3"] | ||
}, | ||
expenses2: { | ||
timestamp: "2024-02-15 00:45:51.571338", | ||
from: "kilvishId2", | ||
to: "kilvishId1", | ||
amount: 300, | ||
tags: ["tag1", "tag2", "tag3"] | ||
}, | ||
expenses3: { | ||
timestamp: "2024-02-14 00:45:51.571338", | ||
from: "kilvishId1", | ||
to: "kilvishId2", | ||
amount: 400, | ||
tags: ["tag1", "tag2", "tag3"] | ||
}, | ||
}); | ||
console.log(request.params); | ||
const snapshot = await db.ref("users/kilvishId1").get() | ||
response.send(snapshot.val()) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters