Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/store record id for edit #18

Merged
merged 7 commits into from Jul 3, 2022

Conversation

wychoong
Copy link
Contributor

currently there is no way to retrieve the id or record, with this PR, you can do this

    public function resolveEventRecord(array $data): Model
    {
        return Appointment::find($data['id']);  // or slug return Appointment::where('slug', $data['extendedProps']['slug']); <- the $data structure not tested
    }

    public function editEvent(array $data): void
    {
        $this->record->update($data);
        $this->refreshEvents();
    }

@saade
Copy link
Owner

saade commented Jun 30, 2022

I dont plan to include any database related stuff into this lib. The ID should be received in $data.

@wychoong
Copy link
Contributor Author

wychoong commented Jul 1, 2022

I dont plan to include any database related stuff into this lib. The ID should be received in $data.

It won’t be in $data if there is no id field in the form. Don’t think that’s the right way of passing id thou, it will be modifiable by user.

@saade
Copy link
Owner

saade commented Jul 1, 2022

you are correct. ill take a look at this tomorrow

@ashleyhood
Copy link
Contributor

For what it is worth, I think this would be helpful. I solve this at the moment by having to store the id on the widget when onEventClick or onEventDrop method is called and then having to retrieve the id in the editEvent method.

@saade
Copy link
Owner

saade commented Jul 2, 2022

@wychoong do you mind writing the docs for this?

also, please resolve the conflicts and we are good to merge this =)

@wychoong
Copy link
Contributor Author

wychoong commented Jul 3, 2022

@wychoong do you mind writing the docs for this?

also, please resolve the conflicts and we are good to merge this =)

sorry for the late, was taking few days off due to covid

@saade saade merged commit 7bc7acc into saade:main Jul 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants