This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//form = require("form-data2"); | |
for (var i = 0; i < updateObject.Documents.length; i++) { | |
try { | |
var document = updateObject.Documents[i]; | |
var directory = Utilities.ConvertToDirectory(document.sUASID); | |
document.directory = directory; | |
var documentPath = path.join(__dirname, "../../", `DownloadFiles/${directory}/${document.filename}`); | |
var contentType = Utilities.GetContentType(document.filename); | |
var promiseToAdd = new Promise((resolve, reject) => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
router.post("/login", [ | |
check("username").isAlphanumeric(), | |
check("password").isLength({ min: 8 }) | |
], async (req, res, next) => { | |
console.log("Testing"); | |
const errors = validationResult(req); | |
if (!errors.isEmpty()) { | |
return res.sendStatus(401); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const RequestTable = () => { | |
const [localReqs, setLocalReqs] = useState({}); | |
const state = useAsync(async () => { | |
let reqs = await GetAccountRequests(); | |
setLocalReqs({ ...localReqs, values: reqs }); | |
}); | |
const ApproveAccount = async () => { | |
console.log("Clicked"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
router.post("/login", [ | |
check("username").isAlphanumeric(), | |
check("password").isLength({ min: 8 }) | |
], async (req, res, next) => { | |
console.log("Testing"); | |
const errors = validationResult(req); | |
if (!errors.isEmpty()) { | |
return res.sendStatus(401); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Model1 { | |
public List<Round> Rounds {get;set;} | |
public Model1(int rounds) | |
{ | |
for (var i = 0; i < rounds; i++) | |
{ | |
Model2.Add(new Model2($"{(i + 1).ToString()}")); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const LoginFormComponent = ({ history }) => { | |
const localState = { | |
username: '', | |
password: '', | |
serverError: false | |
} | |
const handleInputChange = (event) => { | |
localState[event.target.name] = event.target.value |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class TestClass { | |
public int FuseID {get;set;} | |
public int SID {get;set;} | |
public TestClass2 OtherClass {get;set;} | |
} | |
public class TestClass2 { | |
public int? GroupId {get;set;} | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WHD | Name | GroupNumber | |
------------------------------ | |
1 | Name1 | null | |
2 | Name2 | 2 | |
3 | Name3 | 2 | |
desired output | |
WHD | Name | GroupNumber | DisplayName |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MyClass { | |
public int? GroupId {get;set;} | |
public string Name {get;set;} | |
} | |
//Desired Output | |
{ GroupId = 1, Name = "Instance 1 / Instance 2 / Instance 3" } | |
{ GroupId = null, Name = "Instance 4" } | |
{ GroupId = null, Name = "Instance 5" } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const MyComponent = () => { | |
const IsAdmin = useSelector(state => state.UserData.Roles.indexOf("Admin") > -1); | |
const AdminButton = IsAdmin ? <AdminButton>Admin</AdminButton> : null; | |
return ( | |
{AdminButton} | |
} | |
} |