Implemented api key deletion

This commit is contained in:
Jori Lallo
2016-08-26 22:04:28 -07:00
parent 4a1535d6c8
commit 6e39cebb08
9 changed files with 112 additions and 14 deletions

View File

@ -40,6 +40,22 @@ class SearchStore {
this.isFetching = false;
}
@action deleteApiKey = async (id) => {
this.isFetching = true;
try {
await client.post('/apiKeys.delete', {
id,
});
runInAction('deleteApiKey', () => {
this.fetchApiKeys();
});
} catch (e) {
console.error("Something went wrong");
}
this.isFetching = false;
}
@action setKeyName = (value) => {
this.keyName = value.target.value;
}