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

Delete device not working with overriding urls in FCMDeviceAuthorizedViewSet #143

Open
tasawar-hussain opened this issue Feb 2, 2021 · 3 comments

Comments

@tasawar-hussain
Copy link

explicit URLs Binding to ViewSets does not work for delete method to delete a device, throws 404, but works fine for creating a new device

notification_url_patterns = [
    path('register_device',
         FCMDeviceAuthorizedViewSet.as_view({'post': 'create'}), name='create_fcm_device'),
         
    path('remove_device/{registration_id}', FCMDeviceAuthorizedViewSet.as_view(
        {'delete': 'destroy'}), name='delete_fcm_device'), # this does not work

And using a router, it works fine

router = DefaultRouter(trailing_slash=False)
router.register('devices', FCMDeviceAuthorizedViewSet)

notification_url_patterns = [
    path('', include(router.urls))
]

Anything I am missing? as I need to have custom URLs!

@Arham-Aalam
Copy link

I'm searching for the same, seems like they do not have any option for destroy/delete, see:

class DeviceViewSetMixin(object):

The other approach would be to create a custom view to delete the device ID.
Let me know if you found anything?

@tasawar-hussain
Copy link
Author

@xtrinch!

@xtrinch
Copy link
Owner

xtrinch commented Mar 26, 2021

I accept pull requests at all times, otherwise it may take a while for me to get to an issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants