File tree Expand file tree Collapse file tree 6 files changed +20
-25
lines changed Expand file tree Collapse file tree 6 files changed +20
-25
lines changed Original file line number Diff line number Diff line change @@ -8,11 +8,3 @@ import { start } from "/Users/crowlkats/projects/fresh/server.ts";
8
8
import routes from "./routes.gen.ts" ;
9
9
10
10
await start ( routes ) ;
11
-
12
- /*
13
- paths left to do:
14
-
15
- "/api/alias/request": request,
16
- "/api/alias/release": release,
17
- "/api/alias/requests": requests,
18
- */
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ import { Block } from "../components/block.tsx";
6
6
import { TextButton } from "../components/text_button.tsx" ;
7
7
import { ResultButton } from "../components/result_button.tsx" ;
8
8
9
- export function Alias ( ) {
9
+ export default function Alias ( ) {
10
10
return (
11
11
< Layout
12
12
script = "
Original file line number Diff line number Diff line change @@ -15,11 +15,12 @@ export const handler = {
15
15
return couldNotAuthenticate ( ) ;
16
16
}
17
17
18
- const { $metadata : { httpStatusCode } } = await approveRequest (
19
- owner ,
20
- alias ,
21
- ) ;
22
- if ( httpStatusCode !== Status . OK ) {
18
+ try {
19
+ await approveRequest (
20
+ owner ,
21
+ alias ,
22
+ ) ;
23
+ } catch ( _ ) {
23
24
return error ( "Alias approval failed" , Status . BadRequest ) ;
24
25
}
25
26
Original file line number Diff line number Diff line change @@ -15,8 +15,9 @@ export const handler = {
15
15
return couldNotAuthenticate ( ) ;
16
16
}
17
17
18
- const { $metadata : { httpStatusCode } } = await denyRequest ( owner , alias ) ;
19
- if ( httpStatusCode !== Status . OK ) {
18
+ try {
19
+ await denyRequest ( owner , alias ) ;
20
+ } catch ( _ ) {
20
21
return error ( "Alias denial failed" , Status . BadRequest ) ;
21
22
}
22
23
Original file line number Diff line number Diff line change @@ -52,9 +52,9 @@ export const handler = {
52
52
53
53
item . tags [ tag ] = script ;
54
54
55
- const { $metadata : { httpStatusCode } } = await putAlias ( item ) ;
56
-
57
- if ( httpStatusCode !== Status . OK ) {
55
+ try {
56
+ await putAlias ( item ) ;
57
+ } catch ( _ ) {
58
58
return error ( "Release failed" , Status . BadRequest ) ;
59
59
}
60
60
Original file line number Diff line number Diff line change @@ -27,12 +27,13 @@ export const handler = {
27
27
return error ( "Alias already exists" , Status . BadRequest ) ;
28
28
}
29
29
30
- const { $metadata : { httpStatusCode } } = await pushRequest ( {
31
- alias,
32
- owner : user ,
33
- tags : { } ,
34
- } ) ;
35
- if ( httpStatusCode !== Status . OK ) {
30
+ try {
31
+ await pushRequest ( {
32
+ alias,
33
+ owner : user ,
34
+ tags : { } ,
35
+ } ) ;
36
+ } catch ( _ ) {
36
37
return error ( "Alias request failed" , Status . BadRequest ) ;
37
38
}
38
39
You can’t perform that action at this time.
0 commit comments