@@ -16,6 +16,7 @@ import * as Evolver from "client/services.gen";
16
16
import { useEffect } from "react" ;
17
17
import { getEvolverClientForDevice } from "~/utils/evolverClient.server" ;
18
18
import { ControllerConfig } from "~/components/ControllerConfig" ;
19
+ import { ROUTES } from "~/utils/routes" ;
19
20
20
21
export const handle = {
21
22
breadcrumb : ( {
@@ -31,7 +32,12 @@ export const handle = {
31
32
const { id, experiment_id, name, controller_id } = params ;
32
33
return (
33
34
< Link
34
- to = { `/devices/${ id } /${ name } /experiments/${ experiment_id } /${ controller_id } /config` }
35
+ to = { ROUTES . device . experiment . controllers . current . config ( {
36
+ id,
37
+ name,
38
+ experimentId : experiment_id ,
39
+ controllerId : controller_id ,
40
+ } ) }
35
41
>
36
42
{ controller_id }
37
43
</ Link >
@@ -50,7 +56,7 @@ export function ErrorBoundary() {
50
56
</ div >
51
57
</ div >
52
58
53
- < Link to = { `/devices/ ${ id } / ${ name } /config` } className = "link" >
59
+ < Link to = { ROUTES . device . config ( { id , name } ) } className = "link" >
54
60
config
55
61
</ Link >
56
62
</ div >
@@ -239,7 +245,12 @@ export async function action({ request }: ActionFunctionArgs) {
239
245
parsedControllerConfig . name || controller_id ;
240
246
241
247
return redirect (
242
- `/devices/${ id } /${ name } /experiments/${ experiment_id } /controllers/${ newControllerName } /config#${ newControllerName } config` ,
248
+ `${ ROUTES . device . experiment . controllers . current . config ( {
249
+ id,
250
+ name,
251
+ experimentId : experiment_id ,
252
+ controllerId : newControllerName ,
253
+ } ) } #${ newControllerName } config`,
243
254
) ;
244
255
} catch ( error ) {
245
256
return submission . reply ( {
0 commit comments