stefanbund / 311

Interactive Web Development
33 stars 46 forks source link

MP5 CRUD question #24

Closed bdperea closed 7 years ago

bdperea commented 7 years ago

I have the code going and there seems to be no errors, but when I run the site, only put works. It'll appear into the table, but for some reason, get, update, and delete don't work. I'm unsure why it doesn't work, as all variable names are correct, and the policy seems to be correct.

aldwinverzosa commented 7 years ago

I am having the same issues also....

Velestial commented 7 years ago

Im having the same issue too

stefanbund commented 7 years ago

Some things to look at when adapting my CRUD example:

  1. I did my CRUD example on a different table than my query example
  2. my IAM policy/role works for the table in query, you can use the same table in your query code as your query code
  3. in my CRUD example, different partition and sort keys are used in the get, update and delete areas, hence you can't directly copy/paste my code without adapting them to your table structure (your tables likely contain partitionKey and sortKey, not itemID and attribute1, as in my example)
  4. if you've added a new statement to your IAM policy, you might not need it, you can do CRUD on your existing table, since you added the necessary rights to put, get, update etc already

always a little danger directly adapting another's code, need to look at your get, update, delete sections, be sure to use your partitionKey in place of itemID, et cetera.

We will dedicate time Tuesday in class to look at your stuff, as-is, and extend the deadline if need-be @aldwinverzosa @Velestial @bdperea we got yer back

bdperea commented 7 years ago

I'm using itemID and sortKey for my code. For #3 what do you mean you have different partition and sort keys in get, update, and delete>

stefanbund commented 7 years ago

Yes

From Stefan Bund

On Feb 13, 2017, at 11:17 AM, bdperea notifications@github.com wrote:

I'm using itemID and sortKey for my code. For #3 what do you mean you have different partition and sort keys in get, update, and delete>

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

henrydu1371994 commented 7 years ago

My issue says: The provided key element does not match the schema. Did anyone get that also?

Velestial commented 7 years ago

Yeah I got that too on my console.

stefanbund commented 7 years ago

This means that the key that you supplied does not exist within your table, please see my earlier comment

From Stefan Bund

On Feb 13, 2017, at 12:59 PM, henrydu1371994 notifications@github.com wrote:

My issue says: The provided key element does not match the schema. Did anyone get that also?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

bdperea commented 7 years ago

i dont get any feedback whatsoever

stefanbund commented 7 years ago

need more details @bdperea

bdperea commented 7 years ago

When i enter data and click put, it will show up in the table, but when i click get, update or delete, nothing happens. There is no message or error message.

stefanbund commented 7 years ago

This resembles the issue others experience, which I commented to earlier in this chain today, please check this out

On Feb 13, 2017, at 2:29 PM, bdperea notifications@github.com wrote:

When i enter data and click put, it will show up in the table, but when i click get, update or delete, nothing happens. There is no message or error message.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/stefanbund/311/issues/24#issuecomment-279544287, or mute the thread https://github.com/notifications/unsubscribe-auth/ABkO7JHYkvRj4NfAG2z0QuimzAiMeMT5ks5rcNk1gaJpZM4L-TF7.

stefanbund commented 7 years ago

@bdperea if no errors appear, perhaps you need to confirm the put action took place before doing a get -- also, check whether your console runs console.log, to get a minimum output of the item you 'got,' or the associated error msg

stefanbund commented 7 years ago

when using the 'get' button, be sure to specify 'attribute1' in the second input field