File tree 1 file changed +18
-1
lines changed
src/app/(default)/r/[owner]/[repo]/post
1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -34,7 +34,24 @@ export default function ProductPostPage(){
34
34
const { owner, repoName} = context . repoCtx ;
35
35
setParma ( { owner, repo : repoName } )
36
36
const btch = await repo_api . Bhtc ( owner , repoName ) ;
37
- const branches = Object . keys ( btch ) . map ( ( value ) => {
37
+ if ( btch . status !== 200 ) {
38
+ notifications . show ( {
39
+ title : "Error" ,
40
+ message : "Get Branches Error" ,
41
+ color : "red" ,
42
+ } )
43
+ return ;
44
+ }
45
+ const json :AppWrite < Blob > = JSON . parse ( btch . data ) ;
46
+ if ( json . code !== 200 || ! json . data ) {
47
+ notifications . show ( {
48
+ title : "Error" ,
49
+ message : "Get Branches Error" ,
50
+ color : "red" ,
51
+ } )
52
+ return ;
53
+ }
54
+ const branches = Object . keys ( json . data ) . map ( ( value ) => {
38
55
return JSON . parse ( value ) as BranchModel
39
56
} ) ;
40
57
for ( const idx in branches ) {
You can’t perform that action at this time.
0 commit comments