DNS stuff

This commit is contained in:
2024-08-10 17:47:44 -04:00
parent 92df05540b
commit 3df3341235
12 changed files with 587 additions and 11 deletions
+20 -1
View File
@@ -135,6 +135,25 @@ app.api = (function(app){
});
}
function options(url, callback){
$.ajax({
type: 'OPTIONS',
url: baseURL+url,
headers:{
'auth-token': app.auth.getToken()
},
contentType: "application/json; charset=utf-8",
dataType: "json",
complete: function(res, text){
callback(
text !== 'success' ? res.statusText : null,
JSON.parse(res.responseText),
res.status
)
}
});
}
function get(url, callback){
$.ajax({
type: 'GET',
@@ -154,7 +173,7 @@ app.api = (function(app){
});
}
return {post: post, get: get, put: put, delete: remove}
return {post: post, get: get, put: put, delete: remove, options: options,}
})(app)
app.auth = (function(app){
+3
View File
@@ -50,6 +50,9 @@
var value = this.val(); //link to input value
var message;
if(this.prop('disabled')) return true;
//checks if field is required, and length
if(!isNaN(options) && value.length < options){
message = `Must be ${options} characters`;