//Component Edit Methods public ActionResult <ParagraphBox> EditParagraphBoxMethod(ParagraphBox paragraph_box, int admin_id, string admin_token, int site_id) { //check available (better way to do this?) ParagraphBox queried_paragraph_box; try{ queried_paragraph_box = dbQuery.QueryParagraphBoxById(paragraph_box.paragraph_box_id); }catch { JsonFailure f = new JsonFailure($"paragraph_box Id: {paragraph_box.paragraph_box_id} not found."); return(StatusCode(400, f)); } //verify and change if (authenticator.VerifyAdminForLeaf(admin_id, queried_paragraph_box.site_id, admin_token)) { DataPlan data_plan; try{ data_plan = _dataLimiter.ValidateDataPlanB(admin_id, queried_paragraph_box, paragraph_box); }catch (System.ArgumentException e) { return(StatusCode(400, e.Message)); } ParagraphBox changed_tcb = dbQuery.EditParagraphBox(paragraph_box); _dataLimiter.UpdateDataPlan(data_plan); return(paragraph_box); } else { return(StatusCode(400, "Invalid credentials.")); } }