Files
FixIt/layouts/partials/function/get-remote-json.html
T
2024-05-07 16:37:47 +08:00

13 lines
363 B
HTML

{{- $response := dict -}}
{{- with resources.GetRemote .URL .OPTIONS -}}
{{- with .Err -}}
{{- erroridf "error-get-remote-json" "%s" . -}}
{{- else -}}
{{- $response = .Content | transform.Unmarshal -}}
{{- end -}}
{{- else -}}
{{- erroridf "error-get-remote-json" "Unable to get remote resource %q" .URL -}}
{{- end -}}
{{- return $response -}}