added validation and posibility to add custom http status
This commit is contained in:
		@@ -41,7 +41,6 @@ function getData(){
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
function checkUuid(){
 | 
			
		||||
    if(clientUUID == null || clientUUID == undefined || clientUUID == ''){
 | 
			
		||||
        clientUUID = json[0].clientUUID;
 | 
			
		||||
@@ -56,8 +55,19 @@ function getDomain(){
 | 
			
		||||
    return result;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function httpStatusInvalid(){
 | 
			
		||||
    value = $('#httpStatus').val();
 | 
			
		||||
    return value == '';
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function setDataModified(){
 | 
			
		||||
    console.log("dupadupagówno")
 | 
			
		||||
    if(dataModified) return;
 | 
			
		||||
    if(httpStatusInvalid()){
 | 
			
		||||
        $('#btn-save').removeClass('active');
 | 
			
		||||
        $('#btn-save').off();
 | 
			
		||||
        return;
 | 
			
		||||
    }
 | 
			
		||||
    dataModified = true;
 | 
			
		||||
    $('#btn-save').addClass('active');
 | 
			
		||||
    $('#btn-save').click(getUpdate);
 | 
			
		||||
@@ -197,14 +207,14 @@ function clearMock(){
 | 
			
		||||
    $('#httpStatusValues').html('');
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function initializeMock(index){
 | 
			
		||||
    clearMock();
 | 
			
		||||
    fillStaticFields(json[index].clientUUID
 | 
			
		||||
        , json[index].mockedResponseId
 | 
			
		||||
        , json[index].mediaType
 | 
			
		||||
        , json[index].messageBody
 | 
			
		||||
        , json[index].httpStatus);
 | 
			
		||||
    fillHeaderTable(json[index].httpHeaders);
 | 
			
		||||
function initializeMocksetModified(index){
 | 
			
		||||
        clearMock();
 | 
			
		||||
        fillStaticFields(json[index].clientUUID
 | 
			
		||||
            , json[index].mockedResponseId
 | 
			
		||||
            , json[index].mediaType
 | 
			
		||||
            , json[index].messageBody
 | 
			
		||||
            , json[index].httpStatus);
 | 
			
		||||
        fillHeaderTable(json[index].httpHeaders);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function fillStaticFields(uuid, id, mediaType, body, httpStatus){
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user