TF-934 Handle route path when open email in new tab

This commit is contained in:
dab246
2022-11-04 22:00:37 +07:00
committed by Dat H. Pham
parent 4c9beb7526
commit 171b791449
12 changed files with 189 additions and 71 deletions
@@ -15,8 +15,17 @@ extension ServicePathExtension on ServicePath {
if (queryParameters.isEmpty) {
return this;
}
return ServicePath('$path?${queryParameters
.map((query) => '${query.queryName}=${query.queryValue}').join('&')}');
if (path.lastIndexOf('/') == path.length - 1) {
final newPath = path.substring(0, path.length - 1);
return ServicePath('$newPath?${queryParameters
.map((query) => '${query.queryName}=${query.queryValue}')
.join('&')}');
} else {
return ServicePath('$path?${queryParameters
.map((query) => '${query.queryName}=${query.queryValue}')
.join('&')}');
}
}
ServicePath withPathParameter(String? pathParameter) {