dashWithIdExists,err:=sess.Where("id=? AND org_id=?",dash.Id,dash.OrgId).Get(&existing)
dashWithTitleAndFolderExists,err:=sess.Where("org_id=? AND slug=? AND (is_folder=? OR folder_id=?)",dash.OrgId,dash.Slug,dialect.BooleanStr(true),dash.FolderId).Get(&existingByTitleAndFolder)
iferr!=nil{
returnerr
}
if!dashWithIdExists{
returnm.ErrDashboardNotFound
}
// check for is someone else has written in between