<template>
  <div>
    <projectvars :variables="variables" :allvariables="allvariables"/>
  </div>
</template>

<script>
import { fetchVariables } from "@/util/data.js";

import projectvars from "@/components/projectvars";

export default {
  components: { projectvars },
  name: "projectsettings",
  props: {
    ownertype: String,
    ownername: String,
    projectref: Array
  },
  data() {
    return {
      variables: [],
      allvariables: []
    };
  },
  created: async function() {
    this.variables = await fetchVariables(
      "project",
      [this.ownertype, this.ownername, ...this.projectref].join("/"),
      false
    );
    this.allvariables = await fetchVariables(
      "project",
      [this.ownertype, this.ownername, ...this.projectref].join("/"),
      true
    );
  }
};
</script>

<style scoped lang="scss">
@import "@/css/_variables.scss";
</style>
