File tree Expand file tree Collapse file tree 2 files changed +29
-0
lines changed Expand file tree Collapse file tree 2 files changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -60,6 +60,11 @@ var allowedProxyRoutes = []proxyRoute{
6060 method : http .MethodPost ,
6161 path : "/internal/vcr/v2/holder/([a-z-A-Z0-9_\\ -\\ :\\ .%]+)/vc" ,
6262 },
63+ // Delete Verifiable Credentials from wallet
64+ {
65+ method : http .MethodDelete ,
66+ path : "/internal/vcr/v2/holder/([a-z-A-Z0-9_\\ -\\ :\\ .%]+)/vc/(.*)" ,
67+ },
6368}
6469
6570// ConfigureProxy configures the proxy middleware for the given Nuts node address.
Original file line number Diff line number Diff line change 7979 <tr >
8080 <th class =" thead" >Type</th >
8181 <th class =" thead" >Issuer</th >
82+ <th class =" thead" >Actions</th >
8283 </tr >
8384 </thead >
8485 <tbody >
8586 <tr v-for =" credential in details.wallet_credentials" :key =" credential.id" >
8687 <td >{{ credential.type.filter(t => t !== "VerifiableCredential").join(', ') }}</td >
8788 <td >{{ credential.issuer }}</td >
89+ <td >
90+ <button class =" btn btn-secondary" @click =" deleteCredential(credential.credentialSubject.id, credential.id)" >
91+ Delete
92+ </button >
93+ </td >
8894 </tr >
8995 </tbody >
9096 </table >
@@ -169,6 +175,24 @@ export default {
169175 .finally (() => {
170176 this .fetchData ()
171177 })
178+ },
179+ deleteCredential (did , credentialId ) {
180+ if (confirm (" Are you sure you want to delete this credential?" ) !== true ) {
181+ return
182+ }
183+ this .fetchError = undefined
184+ this .$api .delete (` api/proxy/internal/vcr/v2/holder/${ did} /vc/${ encodeURIComponent (credentialId)} ` )
185+ .then (data => {
186+ if (data .reason ) {
187+ this .fetchError = data .reason
188+ }
189+ })
190+ .catch (response => {
191+ this .fetchError = response
192+ })
193+ .finally (() => {
194+ this .fetchData ()
195+ })
172196 }
173197 }
174198}
You can’t perform that action at this time.
0 commit comments