File tree Expand file tree Collapse file tree 1 file changed +17
-2
lines changed
src/authorizations/components/redesigned Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ import {Authorization} from 'src/types'
2828// Actions
2929import { updateAuthorization } from 'src/authorizations/actions/thunks'
3030import { getTelegraf } from 'src/telegrafs/actions/thunks'
31+ import { getBucketSchema } from 'src/buckets/actions/thunks'
3132
3233// Utills
3334import { formatPermissionsObj } from 'src/authorizations/utils/permissions'
@@ -72,8 +73,21 @@ const EditTokenOverlay: FC<Props> = props => {
7273 const name = permissions [ i ] . resource . name
7374 if ( ! name ) {
7475 if ( permissions [ i ] . resource . type === 'telegrafs' ) {
75- const telegraf = await props . getTelegraf ( permissions [ i ] . resource . id )
76- newPerms [ i ] . resource . name = telegraf
76+ try {
77+ const telegraf = await props . getTelegraf ( permissions [ i ] . resource . id )
78+ newPerms [ i ] . resource . name = telegraf
79+ } catch ( e ) {
80+ newPerms [ i ] . resource . name = 'Resource deleted'
81+ }
82+ } else if ( permissions [ i ] . resource . type === 'buckets' ) {
83+ try {
84+ const bucket = await props . getBucketSchema (
85+ permissions [ i ] . resource . id
86+ )
87+ newPerms [ i ] . resource . name = bucket . name
88+ } catch ( e ) {
89+ newPerms [ i ] . resource . name = 'Resource deleted'
90+ }
7791 }
7892 }
7993 }
@@ -206,6 +220,7 @@ const EditTokenOverlay: FC<Props> = props => {
206220const mdtp = {
207221 updateAuthorization,
208222 getTelegraf,
223+ getBucketSchema,
209224}
210225
211226const connector = connect ( null , mdtp )
You can’t perform that action at this time.
0 commit comments