public async Task <IActionResult> CreateNewRecord(CreateNewRecordAddressModel model) { var appid = await _appRepo.GetAppId(model.AccessToken); var createdRecord = await _recordRepo.CreateRecord(model.NewRecordName, model.Type, appid, model.TargetUrl, model.Enabled, model.Tags); return(this.Protocol(ErrorType.Success, $"Successfully created your new record: '{createdRecord.RecordUniqueName}' at {createdRecord.CreationTime}.")); }
public async Task <IActionResult> CreateNewSite(CreateNewSiteAddressModel model) { var appid = await _appRepo.GetAppId(model.AccessToken); var createdSite = await _siteRepo.CreateSite(model.NewSiteName, model.OpenToUpload, model.OpenToDownload, appid); return(this.Protocol(ErrorType.Success, $"Successfully created your new site: '{createdSite.SiteName}' at {createdSite.CreationTime}.")); }
public async Task <IActionResult> CreateNewRecord(CreateNewRecordAddressModel model) { var appid = await _appRepo.GetAppId(model.AccessToken); var conflict = await _recordRepo.GetRecordByName(model.NewRecordName) != null; if (conflict) { return(this.Protocol(ErrorType.NotEnoughResources, $"There is already a record with name: '{model.NewRecordName}'. Please try another new name.")); } var createdRecord = await _recordRepo.CreateRecord(model.NewRecordName, model.Type, appid, model.TargetUrl, model.Enabled); return(this.Protocol(ErrorType.Success, $"Successfully created your new record: '{createdRecord.RecordUniqueName}' at {createdRecord.CreationTime}.")); }
public async Task <IActionResult> CreateNewSite(CreateNewSiteAddressModel model) { var appid = await _appRepo.GetAppId(model.AccessToken); var conflict = await _siteRepo.GetSiteByName(model.NewSiteName) != null; if (conflict) { return(this.Protocol(ErrorType.NotEnoughResources, $"There is already a site with name: '{model.NewSiteName}'. Please try another new name.")); } var createdSite = await _siteRepo.CreateSite(model.NewSiteName, model.OpenToUpload, model.OpenToDownload, appid); return(this.Protocol(ErrorType.Success, $"Successfully created your new site: '{createdSite.SiteName}' at {createdSite.CreationTime}.")); }