refactor: improved teams migrations
This commit is contained in:
@@ -2,6 +2,7 @@ import { BehaviorSubject } from "rxjs"
|
|||||||
import { gql } from "graphql-tag"
|
import { gql } from "graphql-tag"
|
||||||
import pull from "lodash/pull"
|
import pull from "lodash/pull"
|
||||||
import remove from "lodash/remove"
|
import remove from "lodash/remove"
|
||||||
|
import { translateToNewRequest } from "../types/HoppRESTRequest"
|
||||||
import { TeamCollection } from "./TeamCollection"
|
import { TeamCollection } from "./TeamCollection"
|
||||||
import { TeamRequest } from "./TeamRequest"
|
import { TeamRequest } from "./TeamRequest"
|
||||||
import {
|
import {
|
||||||
@@ -466,7 +467,9 @@ export default class TeamCollectionAdapter {
|
|||||||
this.addRequest({
|
this.addRequest({
|
||||||
id: data.teamRequestAdded.id,
|
id: data.teamRequestAdded.id,
|
||||||
collectionID: data.teamRequestAdded.collectionID,
|
collectionID: data.teamRequestAdded.collectionID,
|
||||||
request: JSON.parse(data.teamRequestAdded.request),
|
request: translateToNewRequest(
|
||||||
|
JSON.parse(data.teamRequestAdded.request)
|
||||||
|
),
|
||||||
title: data.teamRequestAdded.title,
|
title: data.teamRequestAdded.title,
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
@@ -548,7 +551,7 @@ export default class TeamCollectionAdapter {
|
|||||||
id: el.id,
|
id: el.id,
|
||||||
collectionID,
|
collectionID,
|
||||||
title: el.title,
|
title: el.title,
|
||||||
request: JSON.parse(el.request),
|
request: translateToNewRequest(JSON.parse(el.request)),
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
import { HoppRESTRequest } from "../types/HoppRESTRequest"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Defines how a Teams request is represented in TeamCollectionAdapter
|
* Defines how a Teams request is represented in TeamCollectionAdapter
|
||||||
*/
|
*/
|
||||||
@@ -5,5 +7,5 @@ export interface TeamRequest {
|
|||||||
id: string
|
id: string
|
||||||
collectionID: string
|
collectionID: string
|
||||||
title: string
|
title: string
|
||||||
request: any
|
request: HoppRESTRequest
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user