async function validateUniqueName(name) {
  const queryString = `/tags?name=eq.${name}`;
  // database request to check for values
  const response = await dbServer.get(queryString);
  if (response.data.length === 1) {
    return { valid: false, msg: false, data: response.data };
  } else if (response.data.length > 0) {
    return { valid: false, msg: "Name already taken" };
  } else return { valid: true };
}
// function to check if name is unique
function to check if name is unique
function to check if name is unique
async function validateUniqueName(name) {
  const queryString = `/tags?name=eq.${name}`;
  const response = await dbServer.get(queryString);
  if (response.data.length === 1) {
    return { valid: false, msg: false, data: response.data };
  } else if (response.data.length > 0) {
    return { valid: false, msg: "Name already taken" };
  } else return { valid: true };
}
async function validateUniqueName ( name ) { const queryString = ` ${ name } ` ; const response = await dbServer . get ( queryString ) ; if ( response . data . length === 1 ) { return { valid : false , msg : false , data : response . data } ; } else if ( response . data . length > 0 ) { return { valid : false , msg : "Name already taken" } ; } else return { valid : true } ; }
function to check if name is unique
function to check if name is unique
// database request to check for values