2
0
mirror of https://github.com/inventree/inventree-app.git synced 2025-06-12 02:05:29 +00:00

Working on implementation of a related field

This commit is contained in:
Oliver
2021-07-25 23:26:27 +10:00
parent a002ce1e8a
commit ca4297ae6d
4 changed files with 113 additions and 2 deletions

View File

@ -128,7 +128,13 @@ class InvenTreeAPI {
String get imageUrl => _makeUrl("/image/");
String makeApiUrl(String endpoint) => _makeUrl("/api/" + endpoint);
String makeApiUrl(String endpoint) {
if (endpoint.startsWith("/api/") || endpoint.startsWith("api/")) {
return _makeUrl(endpoint);
} else {
return _makeUrl("/api/" + endpoint);
}
}
String makeUrl(String endpoint) => _makeUrl(endpoint);