Shared:Api: add Nullable type

This commit is contained in:
Darya Umrikhina 2024-08-13 13:01:12 +04:00
parent e3a8f49f23
commit 2d6b3f3d03
3 changed files with 14 additions and 8 deletions

View File

@ -30,6 +30,7 @@ import { AccountsSearchArea } from "@docspace/shared/enums";
// import axios from "axios";
import { Encoder } from "@docspace/shared/utils/encoder";
import { checkFilterInstance } from "@docspace/shared/utils/common";
import { Nullable } from "types";
import { request } from "../client";
import Filter from "./filter";
@ -93,7 +94,7 @@ export async function getUser(userName = null, headers = null) {
export async function getUserByEmail(
userEmail: string,
confirmKey: string | null = null,
confirmKey: Nullable<string> = null,
) {
const options = {
method: "get",
@ -132,7 +133,7 @@ export function getUserPhoto(userId) {
});
}
export function createUser(data, confirmKey: string | null = null) {
export function createUser(data, confirmKey: Nullable<string> = null) {
const options = {
method: "post",
url: "/people",

View File

@ -33,6 +33,7 @@ import {
TPortalTariff,
TRestoreProgress,
} from "./types";
import { Nullable } from "types";
export function getShortenedLink(link: string) {
return request({
@ -213,7 +214,7 @@ export function sendDeletePortalEmail() {
});
}
export function suspendPortal(confirmKey: string | null = null) {
export function suspendPortal(confirmKey: Nullable<string> = null) {
const options = {
method: "put",
url: "/portal/suspend",
@ -224,7 +225,7 @@ export function suspendPortal(confirmKey: string | null = null) {
return request(options);
}
export function continuePortal(confirmKey: string | null = null) {
export function continuePortal(confirmKey: Nullable<string> = null) {
const options = {
method: "put",
url: "/portal/continue",
@ -235,7 +236,7 @@ export function continuePortal(confirmKey: string | null = null) {
return request(options);
}
export function deletePortal(confirmKey: string | null = null) {
export function deletePortal(confirmKey: Nullable<string> = null) {
const options = {
method: "delete",
url: "/portal/delete",

View File

@ -25,6 +25,7 @@
// International. See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
import axios, { AxiosRequestConfig } from "axios";
import { Nullable } from "types";
import { TWhiteLabel } from "../../utils/whiteLabelHelper";
import { request } from "../client";
import {
@ -78,7 +79,7 @@ export async function getPortalCultures() {
}
export async function getPortalPasswordSettings(
confirmKey: string | null = null,
confirmKey: Nullable<string> = null,
) {
const options: AxiosRequestConfig = {
method: "get",
@ -543,7 +544,10 @@ export function dataReassignmentTerminate(userId) {
});
}
export function ownerChange(ownerId: string, confirmKey: string | null = null) {
export function ownerChange(
ownerId: string,
confirmKey: Nullable<string> = null,
) {
const data = { ownerId };
const options = {
@ -723,7 +727,7 @@ export function getTfaSecretKeyAndQR(confirmKey = null) {
return request(options);
}
export function validateTfaCode(code, confirmKey: string | null = null) {
export function validateTfaCode(code, confirmKey: Nullable<string> = null) {
const data = {
code,
};