dashWithIdExists,err:=sess.Where("id=? AND org_id=?",dash.Id,dash.OrgId).Get(&existing)
iferr!=nil{
returnerr
}
if!dashWithIdExists{
returnm.ErrDashboardNotFound
}
// check for is someone else has written in between
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)