Code Monkey home page Code Monkey logo

Comments (11)

r-park avatar r-park commented on September 13, 2024

Can you show a sample of your rules?

from todo-react-redux.

KillerBee05 avatar KillerBee05 commented on September 13, 2024

from todo-react-redux.

KillerBee05 avatar KillerBee05 commented on September 13, 2024

So what I'm trying to do is have people who are both authenticated and not authenticated to see tasks on the landing page. However it's still blank when I set permissions to true. I also tried to set just the path to tasks/ in the actions.js in the loadTasks () function. But the issue there is that it can't get past each individual authentication key. So I get an error there as well. What I'm thinking is that when I save a task I need to get rid of the authentication key and just save each record without it. If you know a solution that would be a big help!

from todo-react-redux.

r-park avatar r-park commented on September 13, 2024

In order to use path /tasks to get all tasks, you would need to modify your rules to something like:

{
  "rules": {
    "tasks": {
      ".read": true,

      "$uid": {
        ".read": true,
        ".write": "auth !== null && auth.uid === $uid",
        ".indexOn": ["completed"]
      }
    }
  }
}

from todo-react-redux.

KillerBee05 avatar KillerBee05 commented on September 13, 2024

from todo-react-redux.

KillerBee05 avatar KillerBee05 commented on September 13, 2024

seems its still having trouble pulling the record even with indexOn: ["title"] The error im getting in the dev console is that " Cannot read property 'title' of null"

image
image

image

image

from todo-react-redux.

KillerBee05 avatar KillerBee05 commented on September 13, 2024

So I found that its pulling everyones data. But the record is 3 to 4 levels deep. Auth ID -> Record ID -> Data. Do you know of a way to loop twice through something within a render(){ I think it just needs to loop one more time?

image

from todo-react-redux.

Tzikas avatar Tzikas commented on September 13, 2024

+1 Were you ever able to do this? Where is that simulation results page?

from todo-react-redux.

Tzikas avatar Tzikas commented on September 13, 2024

I"m running this

		ref.once('value', (snapshot) => {
			console.log(snapshot);
			console.log(snapshot.val());
                .... 

in the firebase-list.js file with the firebase rules changed to what's above, but I'm still getting only the tasks from the user logged in.

from todo-react-redux.

Tzikas avatar Tzikas commented on September 13, 2024

I see I had to change taskList.path = '/all'; to taskList.path = '/tasks'; like @KillerBee05 . Where is this 'tasks' route decided?

from todo-react-redux.

Tzikas avatar Tzikas commented on September 13, 2024

Ok nvm. I think I understand what is going on here. I'll post what I did incase it helps anyone else. I created a new collection on firebase after I added it to the rules, and then pushed the tasks to that

			firebaseDb.ref('/all')
			.push(value, error => error ? reject(error) : resolve());

and then i can decide what the path is.

export function loadAllTasks(){
	return (dispatch) => {
		taskList.path = '/all';
		console.log('load all')
		console.log(taskList)
	       	
		taskList.subscribe(dispatch);

	} 
	
}

from todo-react-redux.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.