Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Into QA from DEV #106

Merged
merged 5 commits into from
Aug 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions .github/workflows/merge.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ jobs:
name: backend
dockerfile: ./backend/Dockerfile
image: ghcr.io/${{ github.repository }}-backend
qovery_container_name: backend

runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -148,15 +149,15 @@ jobs:
# Download and install Qovery CLI
curl -s https://get.qovery.com | bash

qovery application list \
qovery container list \
--organization ${{ vars.ORGANIZATION }} \
--project ${{ vars.PROJECT }} \
--environment $ENVIRONMENT

# qovery service deploy \
# --organization ${{ vars.ORGANIZATION }} \
# --project ${{ vars.PROJECT }} \
# --environment $ENVIRONMENT \
# --service ${{ matrix.name }} \
# --tag ${{ env.TAG }} \
# --watch
qovery container deploy \
--organization ${{ vars.ORGANIZATION }} \
--project ${{ vars.PROJECT }} \
--environment $ENVIRONMENT \
--container ${{ matrix.qovery_container_name }} \
--tag ${{ env.TAG }} \
--watch
Original file line number Diff line number Diff line change
@@ -1,9 +1,62 @@
'use strict';
// @ts-nocheck
"use strict";

/**
* governance-action-type controller
*/

const { createCoreController } = require('@strapi/strapi').factories;
const axios = require("axios");
const { createCoreController } = require("@strapi/strapi").factories;

module.exports = createCoreController('api::governance-action-type.governance-action-type');
module.exports = createCoreController(
"api::governance-action-type.governance-action-type",
({ strapi }) => ({
async find(ctx) {
const sanitizedQueryParams = await this.sanitizeQuery(ctx);

try {
const { data } = await axios.get(
`${process.env.GOVTOOL_API_BASE_URL}/epoch/params`
);

if (data) {
if (!sanitizedQueryParams.filters) {
sanitizedQueryParams.filters = {};
}

if (+data?.protocol_major < 9) {
sanitizedQueryParams.filters = {
...sanitizedQueryParams.filters,
$and: [
{
gov_action_type_name: {
$ne: "Treasury",
},
},
{
gov_action_type_name: {
$ne: "Info",
},
},
],
};
}
if (+data?.protocol_major === 9) {
sanitizedQueryParams.filters = {
...sanitizedQueryParams.filters,
gov_action_type_name: {
$ne: "Treasury",
},
};
}
}
} catch (error) {}

const { results, pagination } = await strapi
.service("api::governance-action-type.governance-action-type")
.find(sanitizedQueryParams);

return this.transformResponse(results, { pagination });
},
})
);
Loading