GithubHelp home page GithubHelp logo

Comments (1)

jmzaleski avatar jmzaleski commented on August 18, 2024

I repeated the above recipe (except templates z1,z2) using postman, so I could see what the server thought at each point.
looks pretty clear that the save of template z2 ruins the allocations of template z1

make z1, save it

{
        "id": 5,
        "name": "z1",
        "optional": true,
        "instructor_id": 2,
        "tutorial_category": "Classroom TA",
        "department": "Computer Science",
        "created_at": "2017-09-29T11:42:28.854-04:00",
        "updated_at": "2017-09-29T11:42:28.854-04:00",
        "scaling_learning": false,
        "supervisor": "Mathew Zaleski",
        "allocations": [
            {
                "id": 3,
                "num_unit": 42,
                "unit_name": "created in z1",
                "minutes": 60,
                "duty_id": 5,
                "created_at": "2017-09-29T11:43:05.266-04:00",
                "updated_at": "2017-09-29T11:43:05.266-04:00"
            }
        ],
        "trainings": [],
        "categories": []
    }

apply z1 to z2

{
        "id": 5,
        "name": "z1",
        "optional": true,
        "instructor_id": 2,
        "tutorial_category": "Classroom TA",
        "department": "Computer Science",
        "created_at": "2017-09-29T11:42:28.854-04:00",
        "updated_at": "2017-09-29T11:42:28.854-04:00",
        "scaling_learning": false,
        "supervisor": "Mathew Zaleski",
        "allocations": [
            {
                "id": 3,
                "num_unit": 42,
                "unit_name": "created in z1",
                "minutes": 60,
                "duty_id": 5,
                "created_at": "2017-09-29T11:43:05.266-04:00",
                "updated_at": "2017-09-29T11:43:05.266-04:00"
            }
        ],
        "trainings": [],
        "categories": []
    },

create z2 (no allocations)

    {
        "id": 6,
        "name": "z2",
        "optional": true,
        "instructor_id": 2,
        "tutorial_category": "Classroom TA",
        "department": "Computer Science",
        "created_at": "2017-09-29T11:44:29.179-04:00",
        "updated_at": "2017-09-29T11:44:29.179-04:00",
        "scaling_learning": false,
        "supervisor": "Mathew Zaleski",
        "allocations": [],
        "trainings": [],
        "categories": []
    }

apply z1 to z2.. note server is now behind client

{
        "id": 5,
        "name": "z1",
        "optional": true,
        "instructor_id": 2,
        "tutorial_category": "Classroom TA",
        "department": "Computer Science",
        "created_at": "2017-09-29T11:42:28.854-04:00",
        "updated_at": "2017-09-29T11:42:28.854-04:00",
        "scaling_learning": false,
        "supervisor": "Mathew Zaleski",
        "allocations": [
            {
                "id": 3,
                "num_unit": 42,
                "unit_name": "created in z1",
                "minutes": 60,
                "duty_id": 5,
                "created_at": "2017-09-29T11:43:05.266-04:00",
                "updated_at": "2017-09-29T11:43:05.266-04:00"
            }
        ],
        "trainings": [],
        "categories": []
    },
    {
        "id": 6,
        "name": "z2",
        "optional": true,
        "instructor_id": 2,
        "tutorial_category": "Classroom TA",
        "department": "Computer Science",
        "created_at": "2017-09-29T11:44:29.179-04:00",
        "updated_at": "2017-09-29T11:44:29.179-04:00",
        "scaling_learning": false,
        "supervisor": "Mathew Zaleski",
        "allocations": [],
        "trainings": [],
        "categories": []
    }

save z2. BOOM saving z2 removes allocations from z1

   {
        "id": 5,
        "name": "z1",
        "optional": true,
        "instructor_id": 2,
        "tutorial_category": "Classroom TA",
        "department": "Computer Science",
        "created_at": "2017-09-29T11:42:28.854-04:00",
        "updated_at": "2017-09-29T11:42:28.854-04:00",
        "scaling_learning": false,
        "supervisor": "Mathew Zaleski",
        "allocations": [],
        "trainings": [],
        "categories": []
    },
    {
        "id": 6,
        "name": "z2",
        "optional": true,
        "instructor_id": 2,
        "tutorial_category": "Classroom TA",
        "department": "Computer Science",
        "created_at": "2017-09-29T11:44:29.179-04:00",
        "updated_at": "2017-09-29T11:44:29.179-04:00",
        "scaling_learning": false,
        "supervisor": "Mathew Zaleski",
        "allocations": [
            {
                "id": 3,
                "num_unit": 42,
                "unit_name": "created in z1",
                "minutes": 60,
                "duty_id": 5,
                "created_at": "2017-09-29T11:43:05.266-04:00",
                "updated_at": "2017-09-29T11:47:44.079-04:00"
            }
        ],
        "trainings": [],
        "categories": []
    }

from tapp-cp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.