remove deprecated api
This commit is contained in:
+4
-5
@@ -1,5 +1,4 @@
|
||||
import type {Attachment, CaptchaData, LoginRequest, LoginResponse, RegisterRequest, UpdatePasswordRequest, User} from "../types";
|
||||
import {UserAttachType} from "../types";
|
||||
import type {Attachment, CaptchaData, LoginRequest, LoginResponse, RegisterRequest, UpdatePasswordRequest, User, UserAttachType} from "../types";
|
||||
import {axios} from "./BaseAPI";
|
||||
import CommonAPI from "./CommonAPI";
|
||||
|
||||
@@ -55,17 +54,17 @@ async function view(id: string): Promise<User> {
|
||||
|
||||
function getAvatarURL(user?: UserAttachmentOwner) {
|
||||
if (user?.attachmentList) {
|
||||
return findAttachmentByType(user.attachmentList, [UserAttachType.AVATAR, UserAttachType.DEFAULT_AVATAR]);
|
||||
return findAttachmentByType(user.attachmentList, "AVATAR");
|
||||
}
|
||||
}
|
||||
|
||||
function getWrapperURL(user?: UserAttachmentOwner) {
|
||||
if (user?.attachmentList) {
|
||||
return findAttachmentByType(user.attachmentList, [UserAttachType.WRAPPER, UserAttachType.DEFAULT_WRAPPER]);
|
||||
return findAttachmentByType(user.attachmentList, "WRAPPER");
|
||||
}
|
||||
}
|
||||
|
||||
function findAttachmentByType(attachmentList: readonly Attachment[], types: UserAttachType[]) {
|
||||
function findAttachmentByType(attachmentList: readonly Attachment[], ...types: UserAttachType[]) {
|
||||
for (let i = 0; i < attachmentList.length; i++) {
|
||||
const attachType = attachmentList[i].attachType as UserAttachType | undefined;
|
||||
const id = attachmentList[i].id;
|
||||
|
||||
Reference in New Issue
Block a user