Implemented error signal in XML formatter

This commit is contained in:
2023-11-09 12:45:27 +01:00
parent aecbcefc31
commit 5799d60db1
3 changed files with 32 additions and 12 deletions

View File

@@ -16,8 +16,13 @@ const props = defineProps(
}
)
const emit = defineEmits([
'update:result',
'update:error'
])
function chooseType(formatType: String){
if (formatType == "XML Converter"){
if (formatType == "HTML -> XML"){
return "convert";
}
return formatType.toLowerCase();
@@ -42,11 +47,6 @@ function createBody(){
const fetchLink = document.location.protocol + "//" + document.location.hostname + "/libxml/html/" + chooseType(props.formatType);
const emit = defineEmits([
'update:result',
'update:error'
])
function processResponse(formattedCode : any){
var result = formattedCode.result;
emit("update:error", formattedCode.status == "ERR")