Created
September 8, 2018 21:25
-
-
Save kuroski/cef8eb3e6fb71286cc45dded1e360631 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import api from '@/api' | |
export default { | |
SEARCH_USER({ commit }, { username }) { | |
return new Promise(async (resolve, reject) => { | |
try { | |
const user = await api.searchUser(username) | |
commit('SET_USER', user) | |
resolve(user) | |
} catch(error) { | |
reject(error) | |
} | |
}) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment