drop title segment from trend/tech URLs to match Next.js [id] route
This commit is contained in:
parent
5f4782434a
commit
ce42f91a31
|
|
@ -530,7 +530,10 @@ class HomeWidgetRepository {
|
|||
} else if (localData.id != null &&
|
||||
localData.id.toString().isNotEmpty) {
|
||||
String url = "";
|
||||
String title = localData.title?.split(" ").join("-") ?? "";
|
||||
// Note: previously these URLs appended `/$title` as a slug,
|
||||
// but the Next.js trend/tech pages only have a single
|
||||
// dynamic `[id]` segment — adding a second segment makes
|
||||
// the page 404. URLs are now built with id only.
|
||||
|
||||
switch (localData.type) {
|
||||
case "startup":
|
||||
|
|
@ -539,11 +542,11 @@ class HomeWidgetRepository {
|
|||
break;
|
||||
case "technology":
|
||||
url =
|
||||
"https://tech.didvan.app/technology/${localData.id}/$title?accessToken=${RequestService.token}";
|
||||
"https://tech.didvan.app/technology/${localData.id}?accessToken=${RequestService.token}";
|
||||
break;
|
||||
case "trend":
|
||||
url =
|
||||
"https://trend.didvan.app/trend/${localData.id}/$title?accessToken=${RequestService.token}";
|
||||
"https://trend.didvan.app/trend/${localData.id}?accessToken=${RequestService.token}";
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue