Remove friend! 403 (User Unauthorized)

Hi, I’m trying to delete a friend from my app. with function (with solid-file-client):

async removeFriend ( webId) {
     if( await fc.itemExists( webId )){
          await fc.delete(webId).then(() => 200);

and throws me the following error:

I have given permissions to my app:

I very much appreciate your comments…

I think you are using @jeffz solid-file-client lib…
Be careful, this lib is for dealing with resource (file or folder). And you risk to delete your card (profile). It’s quite hard to manage content of the file with sfc, just replace all content.

To deal with resource in your profile/card file I suggest you to take a look at @RubenVerborgh query-ldflex or @Vincent tripledoc .

( Or the new
GitHub - inrupt/solid-client-js: Library for accessing data and managing permissions on data stored in a Solid Pod ( I’ve not tested yet)

1 Like

Solid-File-Client deals with Solid resources as complete documents, it does not operate on the contents of documents, e.g. RDF triples. It is useful to read, upload, download, copy, move, or replace documents and folders, not to edit their details. The code sample you show would have the effect of erasing the entire profile document pointed to by webId. That would cause serious problems, so it would be better to use a finer-grained tool like rdflib, ldflex, or tripledoc.

1 Like

Ldflex support delete .
But the doc has not been updated, i’ve just ask for an update

1 Like

Thanks it has been very helpful :smiley: , I finally got it with rdflib now I add and delete friends, but I see that it is necessary to logout and login again to see the updates.
How could I avoid this?

AFAIK, there’s no easy way to get the new profile settings without logging back in.