"inArray requires at least 1 value" error deleting files with uploadthing
Hey, getting an error that I'm unable to resolve, it says there's no values specified but there's clearly one in the input
Mutation code attached
thanks for any help!
Solution:Jump to solution
You can't delete file using the URLs, you need the file key:
utapi.deleteFiles("https://utfs.io/f/file-key-uuid.png");
❌
utapi.deleteFiles("file-key-uuid.png");
✅...6 Replies
and the mutating code for good measure
oh I just renamed deleteFile mutation to deleteFiles in between screenshots so that's not the error
bump
never solved this one, any help appreciated
Log the input you are getting in the mutation to confirm you are in fact getting the value and it is not getting lost for some reason?
Solution
You can't delete file using the URLs, you need the file key:
utapi.deleteFiles("https://utfs.io/f/file-key-uuid.png");
❌
utapi.deleteFiles("file-key-uuid.png");
✅oh i totally gave up on this but if it works i will thank you forever
sorry i missed your message too markr
i'll give it a try tomorrow
ok i took a long break but yes this works thank you so much