Batch create convenience: overwrite, ignore, throw an error if data exists on DB

jenina
jenina
edited February 10 in Help Me!
There should only one food menu for every single date. I have a single day food create and a weekly one, the difference you only submit once for the whole week.

Usually in a scenario like this, it is common to throw an error saying that a data already exists.

I am thinking if a user created a single food menu for a day, and decided to use the weekly food menu, there is a chance that it might overlap it.

My question now is: Is it fine to ignore it and process those that doesn't exists for convenience? And just give an information/warning message that a certain was ignored because it already exist?

OR

Should I just overwrite it? But overwriting seems kinda inconvenient if the user forgot that he already made one for that day and overwrote it with the new one.

BUT

Is there by any chance you think they will forgot that they have already made one for a certain day? Or any reason that it really is inconvenient?

OR

Just stick to the usual and just throw an error and not process it first?

Comments

  • calder12
    calder12
    Senior Member Posts: 13,496
    That was nearly incomprehensible but what the hell.

    Let's get this straight, you have an interface where your user can enter a menu item for the day. You're concerned that if a user tries to enter data for a day that already has an item what will happen?

    Why don't you just load existing data into the interface to begin with? Then your user knows what's there already, then when you process the data you overwrite all the values, this also allows your user to change existing data.

    When asking a question some context helps, a LOT. You haven't explained at all what this even is, is it a website, is it WordPress?
  • jenina
    jenina
    edited February 10
    calder12 wrote: »
    You're concerned that if a user tries to enter data for a day that already has an item what will happen?

    Yes. That's what I am asking.
    calder12 wrote: »
    That was nearly incomprehensible but what the hell.
    Why don't you just load existing data into the interface to begin with? Then your user knows what's there already, then when you process the data you overwrite all the values, this also allows your user to change existing data.

    Good idea. I appreciate this one.
    calder12 wrote: »
    When asking a question some context helps, a LOT. You haven't explained at all what this even is, is it a website, is it WordPress?

    This is the page of a website for the owner/admins to put their food menus that will be shown on public.

    I'm a freelance full-stack developer. I am mainly/better at back-end side and admit that I suck at UI/UX and always rely on public's opinion/suggestions.

    I am so used to the usual CRUD pattern. Never thought of loading the existing data on a "Create" page.
  • handcraftedweb
    handcraftedweb
    thought leader Left coastPosts: 6,813
    It seems analogous to saving a file. If the file (menu at specific date) already exists the user is given the option of overwriting or cancelling.
    Just stick to the usual and just throw an error and not process it first?

    It's not an error it's just something that requires confirmation. I think.
Sign In or Register to comment.
© Copyright 2003 - 2016 - DT by Kooc Media