hqchai / UCLA-Translate-Flashcards

0 stars 0 forks source link

Flashcards backend #24

Closed keylime503 closed 10 years ago

jisaji commented 10 years ago

What exactly is this?

keylime503 commented 10 years ago

Given an existing deck in the datstore, update its contents

jisaji commented 10 years ago

I see this in the facade:

public void updateDeck(Deck newDeck) {

    deleteDeck(newDeck.name);
    storeDeck(newDeck);
    return;    
}

Will this actually work? Because right now I have 2 decks with the same name and I dont understand how a deck is uniquely identified. This is a problem we will have to deal with in editing deck names as well

keylime503 commented 10 years ago

Deck is uniquely identified by name AND userId

keylime503 commented 10 years ago

And I don't know if this will actually work, can't test it until there is a front-end form for updating deck meta-data i.e. deck name

jisaji commented 10 years ago

So how do I have 2 decks with the same name, assuming the userId for both decks is the same as well?

keylime503 commented 10 years ago

Sorry, meant deck SHOULD be uniquely identified by those two things. But you're correct, there is nothing to stop you from adding two decks with the same name b/c datastore generates new Key for the second one. Right now, adding two decks w/ same name is a bug but I don't think its a high priority.