Fix php endpoint not working with param url

This commit is contained in:
Thomas Fransolet 2024-07-02 16:37:42 +02:00
parent a9f9aa81e0
commit d79c4882fc

View File

@ -110,7 +110,7 @@ class _UploadOnlineResourceContainerState extends State<UploadOnlineResourceCont
onChanged: (String text) { onChanged: (String text) {
widget.resourceDTO.url = text; // TODO check if ok widget.resourceDTO.url = text; // TODO check if ok
widget.onChanged(widget.resourceDTO); widget.onChanged(widget.resourceDTO);
widget.resourceDTO.type = _isYouTubeVideo(widget.resourceDTO.url!) ? ResourceType.VideoUrl : widget.resourceDTO.url!.endsWith("json") || widget.resourceDTO.url!.endsWith("php") ? ResourceType.JsonUrl : ResourceType.ImageUrl; // ou VideoUrl widget.resourceDTO.type = _isYouTubeVideo(widget.resourceDTO.url!) ? ResourceType.VideoUrl : widget.resourceDTO.url!.endsWith("json") || widget.resourceDTO.url!.contains(".php") ? ResourceType.JsonUrl : ResourceType.ImageUrl; // ou VideoUrl
print("URL OR NOOOOT ?"); print("URL OR NOOOOT ?");
print(widget.resourceDTO.type); print(widget.resourceDTO.type);
}, },