decord/source/modules/threads/FormError.tsx

62 lines
2.1 KiB
TypeScript
Raw Normal View History

2026-07-25 08:10:48 +00:00
// Module ID: 15371
// Function ID: 117242
2026-07-20 16:05:17 +00:00
// Name: formSubmitError
2026-07-25 08:10:48 +00:00
// Dependencies: [1212, 6126, 2]
2026-07-20 16:05:17 +00:00
// Exports: makeApiNameRequiredError, makeAutomodViolationError, makeEmptyMessageError, makeEmptyTitleError, renderError
2026-07-25 08:10:48 +00:00
// Module 15371 (formSubmitError)
2026-07-20 16:05:17 +00:00
function formSubmitError(type) {
const obj = { type };
let tmp = null;
if (null != arg1) {
tmp = arg1;
}
obj.message = tmp;
return obj;
}
function makeEmptyContentError(arg0) {
return formSubmitError(obj.EmptyContent, arg0);
}
2026-07-23 10:11:24 +00:00
let obj = { EmptyContent: 0, [0]: "EmptyContent", AutomodViolation: 1, [1]: "AutomodViolation", ApiValidation: 2, [2]: "ApiValidation" };
const result = require("set").fileFinishedImporting("modules/threads/FormError.tsx");
2026-07-20 16:05:17 +00:00
export const FormSubmitErrorType = obj;
export const makeEmptyTitleError = function makeEmptyTitleError() {
2026-07-23 10:11:24 +00:00
const intl = require(1212) /* getSystemLocale */.intl;
return makeEmptyContentError(intl.string(require(1212) /* getSystemLocale */.t.uXA573));
2026-07-20 16:05:17 +00:00
};
export const makeEmptyMessageError = function makeEmptyMessageError() {
2026-07-23 10:11:24 +00:00
const intl = require(1212) /* getSystemLocale */.intl;
return makeEmptyContentError(intl.string(require(1212) /* getSystemLocale */.t.kesTVT));
2026-07-20 16:05:17 +00:00
};
export const makeApiNameRequiredError = function makeApiNameRequiredError() {
2026-07-23 10:11:24 +00:00
const intl = require(1212) /* getSystemLocale */.intl;
return formSubmitError(obj.ApiValidation, intl.string(require(1212) /* getSystemLocale */.t.uXA573));
2026-07-20 16:05:17 +00:00
};
export const makeAutomodViolationError = function makeAutomodViolationError(errorResponseBody, id) {
2026-07-25 08:10:48 +00:00
const obj = require(6126) /* _callSuper */;
2026-07-20 16:05:17 +00:00
id = undefined;
if (null != id) {
id = id.id;
}
return formSubmitError(obj.AutomodViolation, obj.getAutomodErrorMessageFromErrorResponse(errorResponseBody, id));
};
export const renderError = function renderError(type, content) {
let tmp = null;
if (null != type) {
if (type.type === obj.EmptyContent) {
if (null != content.content) {
tmp = null;
const str = content.content;
}
}
const message = type.message;
let tmp3 = null;
if (null != message) {
tmp3 = message;
}
tmp = tmp3;
}
return tmp;
};