mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-17 22:03:50 +02:00
refactor: src/types
This commit is contained in:
@@ -4,7 +4,7 @@ import { useUserStore } from '../stores';
|
||||
const loginReq = {
|
||||
/**
|
||||
* @param {{ code: string }} params One-time password
|
||||
* @returns {Promise<{json: any, params}>}
|
||||
* @returns {Promise<{json: any, params: { code: string }}>}
|
||||
*/
|
||||
verifyOTP(params) {
|
||||
return request('auth/twofactorauth/otp/verify', {
|
||||
@@ -21,7 +21,7 @@ const loginReq = {
|
||||
|
||||
/**
|
||||
* @param {{ code: string }} params One-time token
|
||||
* @returns {Promise<{json: any, params}>}
|
||||
* @returns {Promise<{json: any, params: { code: string }}>}
|
||||
*/
|
||||
verifyTOTP(params) {
|
||||
return request('auth/twofactorauth/totp/verify', {
|
||||
@@ -38,7 +38,7 @@ const loginReq = {
|
||||
|
||||
/**
|
||||
* @param {{ code: string }} params One-time token
|
||||
* @returns {Promise<{json: any, params}>}
|
||||
* @returns {Promise<{json: any, params: { code: string }}>}
|
||||
*/
|
||||
verifyEmailOTP(params) {
|
||||
return request('auth/twofactorauth/emailotp/verify', {
|
||||
|
||||
@@ -4,7 +4,7 @@ import { useUserStore } from '../stores/user';
|
||||
const friendReq = {
|
||||
/**
|
||||
* Fetch friends of current user.
|
||||
* @type {import('../types/friend').getFriends}
|
||||
* @type {import('../types/api/friend').GetFriends}
|
||||
*/
|
||||
getFriends(params) {
|
||||
const userStore = useUserStore();
|
||||
@@ -29,7 +29,7 @@ const friendReq = {
|
||||
|
||||
/**
|
||||
* @param {{ userId: string }} params
|
||||
* @returns {Promise<{json: T, params}>}
|
||||
* @returns {Promise<{json: any, params: { userId: string }}>}
|
||||
*/
|
||||
sendFriendRequest(params) {
|
||||
return request(`user/${params.userId}/friendRequest`, {
|
||||
@@ -45,7 +45,7 @@ const friendReq = {
|
||||
|
||||
/**
|
||||
* @param {{ userId: string }} params
|
||||
* @returns {Promise<{json: any, params}>}
|
||||
* @returns {Promise<{json: any, params: { userId: string }}>}
|
||||
*/
|
||||
cancelFriendRequest(params) {
|
||||
return request(`user/${params.userId}/friendRequest`, {
|
||||
@@ -61,7 +61,7 @@ const friendReq = {
|
||||
|
||||
/**
|
||||
* @param {{ userId: string }} params
|
||||
* @returns {Promise<{json: any, params}>}
|
||||
* @returns {Promise<{json: any, params: { userId: string }}>}
|
||||
*/
|
||||
deleteFriend(params) {
|
||||
return request(`auth/user/friends/${params.userId}`, {
|
||||
@@ -77,7 +77,7 @@ const friendReq = {
|
||||
|
||||
/**
|
||||
* @param {{ userId: string }} params
|
||||
* @returns {Promise<{json: any, params}>}
|
||||
* @returns {Promise<{json: any, params: { userId: string }}>}
|
||||
*/
|
||||
getFriendStatus(params) {
|
||||
return request(`user/${params.userId}/friendStatus`, {
|
||||
|
||||
Reference in New Issue
Block a user