Skip to content
Snippets Groups Projects
Commit 713b3e79 authored by sandcha's avatar sandcha
Browse files

Remove openfisca parameters dir from metadata

Update to new openfisca-france-json syntax
parent 6f95b603
No related branches found
No related tags found
1 merge request!6Met à jour les dépendances de l'application
......@@ -72,7 +72,6 @@
{ branch, group, project, rawUrlTemplate }: App.SessionOpenFiscaRepository,
parameter: Parameter,
): string | undefined {
const path = `${metadata.parameters_dir}/${parameter.file_path}`
// Can't use:
// return eval("`" + rawUrlTemplate + "`")
// because using direct eval with a bundler is not recommended and may cause problems
......@@ -83,7 +82,7 @@
"project",
"path",
"return `" + rawUrlTemplate + "`",
)(branch, group, project, path)
)(branch, group, project, parameter.file_path)
}
</script>
......
......@@ -67,9 +67,9 @@ export const put: RequestHandler = async ({ request, params }) => {
: parameter.file_path
const parameterContentUrl = `https://api.github.com/repos/${
openfiscaRepository.group
}/${openfiscaRepository.project}/contents/${
metadata.parameters_dir
}/${filePath}?ref=${encodeURIComponent(openfiscaRepository.branch)}`
}/${
openfiscaRepository.project
}/contents/${filePath}?ref=${encodeURIComponent(openfiscaRepository.branch)}`
const parameterContentResponse = await fetch(parameterContentUrl, {
headers: {
Accept: "application/vnd.github.v3+json",
......@@ -123,7 +123,7 @@ export const put: RequestHandler = async ({ request, params }) => {
}
// Update parameter & commit it.
const parameterUpdateUrl = `https://api.github.com/repos/${openfiscaRepository.group}/${openfiscaRepository.project}/contents/${metadata.parameters_dir}/${filePath}`
const parameterUpdateUrl = `https://api.github.com/repos/${openfiscaRepository.group}/${openfiscaRepository.project}/contents/${filePath}`
const parameterUpdateResponse = await fetch(parameterUpdateUrl, {
body: JSON.stringify(
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment