Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
GGCE
GGCE Web
Commits
c14d5699
Commit
c14d5699
authored
Sep 30, 2021
by
Maksym Tishchenko
Browse files
Source descriptors
parent
94f1e49d
Changes
26
Hide whitespace changes
Inline
Side-by-side
workspaces/client/locales/en/client.json
View file @
c14d5699
...
...
@@ -111,7 +111,13 @@
"InventoryViabilityRule"
:
"Inventory viability rule"
,
"InventoryViabilityRule_plural"
:
"Inventory viability rules"
,
"InventoryViabilityData"
:
"Inventory viability data"
,
"InventoryViabilityData_plural"
:
"Inventory viability datas"
"InventoryViabilityData_plural"
:
"Inventory viability datas"
,
"SourceDescriptor"
:
"Source descriptor"
,
"SourceDescriptor_plural"
:
"Source descriptors"
,
"SourceDescriptorCode"
:
"Source descriptor code"
,
"SourceDescriptorCode_plural"
:
"Source descriptor codes"
,
"SourceDescriptorLang"
:
"Source descriptor translation"
,
"SourceDescriptorLang_plural"
:
"Source descriptor translations"
},
"Cooperator"
:
{
"id"
:
"Cooperator ID"
,
...
...
@@ -1208,6 +1214,29 @@
"shipAddress"
:
"Shipping address"
,
"shipCountry"
:
"Shipping country"
,
"shipTelephone"
:
"Shipping telephone"
},
"SourceDescriptor"
:
{
"codedName"
:
"Descriptor name"
,
"categoryCode"
:
"Category"
,
"dataTypeCode"
:
"Data Type"
,
"isCoded"
:
"Is Coded?"
,
"maxLength"
:
"Max Length"
,
"numericFormat"
:
"Numeric Format"
,
"numericMaximum"
:
"Numeric Maximum"
,
"numericMinimum"
:
"Numeric Minimum"
,
"originalValueTypeCode"
:
"Original Value Type"
,
"originalValueFormat"
:
"Original Value Format"
,
"ontologyUrl"
:
"Ontology URL"
},
"SourceDescriptorCode"
:
{
"sourceDescriptor"
:
"Descriptor"
,
"code"
:
"Code"
},
"SourceDescriptorLang"
:
{
"sourceDescriptor"
:
"Descriptor"
,
"sysLang"
:
"Language"
,
"title"
:
"Title"
,
"description"
:
"Description"
}
}
}
\ No newline at end of file
workspaces/client/src/model/gringlobal/SourceDescriptor.ts
0 → 100644
View file @
c14d5699
/**
* SourceDescriptor
*
* GRIN-Global CE API
*/
class
SourceDescriptor
{
public
createdBy
:
string
;
public
createdDate
:
Date
;
public
modifiedBy
:
string
;
public
modifiedDate
:
Date
;
public
ownedBy
:
string
;
public
ownedDate
:
Date
;
public
id
:
number
;
public
categoryCode
:
string
;
public
codedName
:
string
;
public
dataTypeCode
:
string
;
public
isCoded
:
string
;
public
maxLength
:
number
;
public
numericFormat
:
string
;
public
numericMaximum
:
number
;
public
numericMinimum
:
number
;
public
ontologyUrl
:
string
;
public
originalValueFormat
:
string
;
public
originalValueTypeCode
:
string
;
public
note
:
string
;
public
static
CodeGroup
=
{
categoryCode
:
"
SOURCE_DESCRIPTOR_CATEGORY
"
,
dataTypeCode
:
'
CROP_TRAIT_DATA_TYPE
'
,
// SOURCE_DESCRIPTOR_DATA_TYPE
originalValueTypeCode
:
'
CROP_TRAIT_DATA_TYPE
'
,
// SOURCE_DESCRIPTOR_DATA_TYPE
}
}
export
default
SourceDescriptor
;
workspaces/client/src/model/gringlobal/SourceDescriptorCode.ts
0 → 100644
View file @
c14d5699
import
AclSid
from
'
@gringlobal-ce/client/model/acl/AclSid
'
;
import
SourceDescriptor
from
'
@gringlobal-ce/client/model/gringlobal/SourceDescriptor
'
;
/**
* SourceDescriptorCode
*
* GRIN-Global CE API
*/
class
SourceDescriptorCode
{
public
createdBy
:
number
;
public
createdDate
:
Date
;
public
modifiedBy
:
number
;
public
modifiedDate
:
Date
;
public
ownedBy
:
AclSid
;
public
ownedDate
:
Date
;
public
code
:
string
;
public
id
:
number
;
public
sourceDescriptor
:
SourceDescriptor
;
}
export
default
SourceDescriptorCode
;
workspaces/client/src/model/gringlobal/SourceDescriptorCodeFilter.ts
0 → 100644
View file @
c14d5699
import
DateFilter
from
'
@gringlobal-ce/client/model/gringlobal/DateFilter
'
;
import
SourceDescriptorFilter
from
'
@gringlobal-ce/client/model/gringlobal/SourceDescriptorFilter
'
;
/**
* SourceDescriptorCodeFilter
*
* GRIN-Global CE API
*/
class
SourceDescriptorCodeFilter
{
public
NOT
:
SourceDescriptorCodeFilter
;
public
NULL
:
string
[];
public
NOTNULL
:
string
[];
public
id
:
number
[];
public
createdBy
:
number
[];
public
createdDate
:
DateFilter
;
public
modifiedBy
:
number
[];
public
modifiedDate
:
DateFilter
;
public
ownedBy
:
number
[];
public
ownedDate
:
DateFilter
;
public
code
:
string
[];
public
sourceDescriptorFilter
:
Partial
<
SourceDescriptorFilter
>
;
}
export
default
SourceDescriptorCodeFilter
;
workspaces/client/src/model/gringlobal/SourceDescriptorCodeLang.ts
0 → 100644
View file @
c14d5699
import
AclSid
from
'
@gringlobal-ce/client/model/acl/AclSid
'
;
import
SourceDescriptorCode
from
'
@gringlobal-ce/client/model/gringlobal/SourceDescriptorCode
'
;
import
SysLang
from
'
@gringlobal-ce/client/model/gringlobal/SysLang
'
;
/**
* SourceDescriptorCodeLang
*
* GRIN-Global CE API
*/
class
SourceDescriptorCodeLang
{
public
createdBy
:
number
;
public
createdDate
:
Date
;
public
modifiedBy
:
number
;
public
modifiedDate
:
Date
;
public
ownedBy
:
AclSid
;
public
ownedDate
:
Date
;
public
entity
:
SourceDescriptorCode
;
public
description
:
string
;
public
title
:
string
;
public
sysLang
:
SysLang
;
public
id
:
number
;
}
export
default
SourceDescriptorCodeLang
;
workspaces/client/src/model/gringlobal/SourceDescriptorFilter.ts
0 → 100644
View file @
c14d5699
import
DateFilter
from
'
@gringlobal-ce/client/model/gringlobal/DateFilter
'
;
import
StringFilter
from
'
@gringlobal-ce/client/model/common/StringFilter
'
;
import
NumberFilter
from
'
@gringlobal-ce/client/model/common/NumberFilter
'
;
/**
* SourceDescriptorFilter
*
* GRIN-Global CE API
*/
class
SourceDescriptorFilter
{
public
NOT
:
SourceDescriptorFilter
;
public
NULL
:
string
[];
public
NOTNULL
:
string
[];
public
id
:
number
[];
public
createdBy
:
number
[];
public
createdDate
:
DateFilter
;
public
modifiedBy
:
number
[];
public
modifiedDate
:
DateFilter
;
public
ownedBy
:
number
[];
public
ownedDate
:
DateFilter
;
public
categoryCode
:
string
[];
public
codedName
:
string
[];
public
dataTypeCode
:
string
[];
public
description
:
StringFilter
;
public
coded
:
boolean
;
public
maxLength
:
NumberFilter
;
public
note
:
StringFilter
;
public
numericFormat
:
string
[];
public
numericMaximum
:
NumberFilter
;
public
numericMinimum
:
NumberFilter
;
public
ontologyUrl
:
string
[];
public
originalValueFormat
:
string
[];
public
originalValueTypeCode
:
string
[];
}
export
default
SourceDescriptorFilter
;
workspaces/client/src/model/gringlobal/SourceDescriptorLang.ts
0 → 100644
View file @
c14d5699
import
AclSid
from
'
@gringlobal-ce/client/model/acl/AclSid
'
;
import
SourceDescriptor
from
'
@gringlobal-ce/client/model/gringlobal/SourceDescriptor
'
;
import
SysLang
from
'
@gringlobal-ce/client/model/gringlobal/SysLang
'
;
/**
* SourceDescriptorLang
*
* GRIN-Global CE API
*/
class
SourceDescriptorLang
{
public
createdBy
:
number
;
public
createdDate
:
Date
;
public
modifiedBy
:
number
;
public
modifiedDate
:
Date
;
public
ownedBy
:
AclSid
;
public
ownedDate
:
Date
;
public
entity
:
SourceDescriptor
;
public
description
:
string
;
public
title
:
string
;
public
sysLang
:
SysLang
;
public
id
:
number
;
}
export
default
SourceDescriptorLang
;
workspaces/client/src/model/gringlobal/TranslatedSourceDescriptor.ts
0 → 100644
View file @
c14d5699
import
TranslatedSourceDescriptorCode
from
'
@gringlobal-ce/client/model/gringlobal/TranslatedSourceDescriptorCode
'
;
/**
* TranslatedSourceDescriptor
*
* GRIN-Global CE API
*/
class
TranslatedSourceDescriptor
{
public
createdBy
:
string
;
public
createdDate
:
Date
;
public
modifiedBy
:
string
;
public
modifiedDate
:
Date
;
public
ownedBy
:
string
;
public
ownedDate
:
Date
;
public
id
:
number
;
public
categoryCode
:
string
;
public
codedName
:
string
;
public
dataTypeCode
:
string
;
public
isCoded
:
string
;
public
maxLength
:
number
;
public
numericFormat
:
string
;
public
numericMaximum
:
number
;
public
numericMinimum
:
number
;
public
ontologyUrl
:
string
;
public
originalValueFormat
:
string
;
public
originalValueTypeCode
:
string
;
public
note
:
string
;
public
title
:
string
;
public
description
:
string
;
public
codes
:
TranslatedSourceDescriptorCode
[];
}
export
default
TranslatedSourceDescriptor
;
workspaces/client/src/model/gringlobal/TranslatedSourceDescriptorCode.ts
0 → 100644
View file @
c14d5699
import
AclSid
from
'
@gringlobal-ce/client/model/acl/AclSid
'
;
import
SourceDescriptor
from
'
@gringlobal-ce/client/model/gringlobal/SourceDescriptor
'
;
/**
* TranslatedSourceDescriptorCode
*
* GRIN-Global CE API
*/
class
TranslatedSourceDescriptorCode
{
public
createdBy
:
number
;
public
createdDate
:
Date
;
public
modifiedBy
:
number
;
public
modifiedDate
:
Date
;
public
ownedBy
:
AclSid
;
public
ownedDate
:
Date
;
public
code
:
string
;
public
id
:
number
;
public
sourceDescriptor
:
SourceDescriptor
;
public
title
:
string
;
public
description
:
string
;
}
export
default
TranslatedSourceDescriptorCode
;
workspaces/client/src/model/gringlobal/index.ts
View file @
c14d5699
...
...
@@ -76,6 +76,12 @@ import InventoryViabilityAction from './InventoryViabilityAction';
import
InventoryViabilityRule
from
'
./InventoryViabilityRule
'
;
import
InventoryViabilityRuleFilter
from
'
./InventoryViabilityRuleFilter
'
;
import
AuditLogFilter
from
'
./AuditLogFilter
'
;
import
SourceDescriptor
from
'
./SourceDescriptor
'
;
import
SourceDescriptorFilter
from
'
./SourceDescriptorFilter
'
;
import
SourceDescriptorLang
from
'
./SourceDescriptorLang
'
;
import
SourceDescriptorCode
from
'
./SourceDescriptorCode
'
;
import
SourceDescriptorCodeFilter
from
'
./SourceDescriptorCodeFilter
'
;
import
SourceDescriptorCodeLang
from
'
./SourceDescriptorCodeLang
'
;
export
{
AuditLog
,
...
...
@@ -120,6 +126,12 @@ export {
InventoryViabilityActionFilter
,
InventoryViabilityAction
,
InventoryViabilityRule
,
InventoryViabilityRuleFilter
,
SourceDescriptor
,
SourceDescriptorFilter
,
SourceDescriptorLang
,
SourceDescriptorCode
,
SourceDescriptorCodeFilter
,
SourceDescriptorCodeLang
,
};
...
...
@@ -158,6 +170,8 @@ type OrderRequestItemActionFilteredPage = FilteredPage<OrderRequestItemAction, O
type
InventoryViabilityFilteredPage
=
FilteredPage
<
InventoryViability
,
InventoryViabilityFilter
>
;
type
InventoryViabilityActionFilteredPage
=
FilteredPage
<
InventoryViabilityAction
,
InventoryViabilityActionFilter
>
;
type
InventoryViabilityRuleFilteredPage
=
FilteredPage
<
InventoryViabilityRule
,
InventoryViabilityRuleFilter
>
;
type
SourceDescriptorFilteredPage
=
FilteredPage
<
SourceDescriptor
,
SourceDescriptorFilter
>
;
type
SourceDescriptorCodeFilteredPage
=
FilteredPage
<
SourceDescriptorCode
,
SourceDescriptorCodeFilter
>
;
// Crop Trait Observation
interface
IObservationData
{
...
...
@@ -210,5 +224,7 @@ export {
IWithObservationsData
,
InventoryViabilityFilteredPage
,
InventoryViabilityActionFilteredPage
,
InventoryViabilityRuleFilteredPage
InventoryViabilityRuleFilteredPage
,
SourceDescriptorFilteredPage
,
SourceDescriptorCodeFilteredPage
};
workspaces/client/src/model/translations.json
View file @
c14d5699
...
...
@@ -96,7 +96,13 @@
"InventoryViabilityRule"
:
"Inventory viability rule"
,
"InventoryViabilityRule_plural"
:
"Inventory viability rules"
,
"InventoryViabilityData"
:
"Inventory viability data"
,
"InventoryViabilityData_plural"
:
"Inventory viability datas"
"InventoryViabilityData_plural"
:
"Inventory viability datas"
,
"SourceDescriptor"
:
"Source descriptor"
,
"SourceDescriptor_plural"
:
"Source descriptors"
,
"SourceDescriptorCode"
:
"Source descriptor code"
,
"SourceDescriptorCode_plural"
:
"Source descriptor codes"
,
"SourceDescriptorLang"
:
"Source descriptor translation"
,
"SourceDescriptorLang_plural"
:
"Source descriptor translations"
},
"Cooperator"
:
{
"id"
:
"Cooperator ID"
,
...
...
@@ -1196,5 +1202,28 @@
"shipAddress"
:
"Shipping address"
,
"shipCountry"
:
"Shipping country"
,
"shipTelephone"
:
"Shipping telephone"
},
"SourceDescriptor"
:
{
"codedName"
:
"Descriptor name"
,
"categoryCode"
:
"Category"
,
"dataTypeCode"
:
"Data Type"
,
"isCoded"
:
"Is Coded?"
,
"maxLength"
:
"Max Length"
,
"numericFormat"
:
"Numeric Format"
,
"numericMaximum"
:
"Numeric Maximum"
,
"numericMinimum"
:
"Numeric Minimum"
,
"originalValueTypeCode"
:
"Original Value Type"
,
"originalValueFormat"
:
"Original Value Format"
,
"ontologyUrl"
:
"Ontology URL"
},
"SourceDescriptorCode"
:
{
"sourceDescriptor"
:
"Descriptor"
,
"code"
:
"Code"
},
"SourceDescriptorLang"
:
{
"sourceDescriptor"
:
"Descriptor"
,
"sysLang"
:
"Language"
,
"title"
:
"Title"
,
"description"
:
"Description"
}
}
workspaces/client/src/service/SourceDescriptorService.ts
0 → 100644
View file @
c14d5699
import
*
as
UrlTemplate
from
'
url-template
'
;
import
*
as
QueryString
from
'
query-string
'
;
import
{
AxiosInstance
,
AxiosRequestConfig
}
from
'
axios
'
;
import
SourceDescriptor
from
'
@gringlobal-ce/client/model/gringlobal/SourceDescriptor
'
;
import
TranslatedSourceDescriptor
from
'
@gringlobal-ce/client/model/gringlobal/TranslatedSourceDescriptor
'
;
import
SourceDescriptorLang
from
'
@gringlobal-ce/client/model/gringlobal/SourceDescriptorLang
'
;
import
SourceDescriptorCode
from
'
@gringlobal-ce/client/model/gringlobal/SourceDescriptorCode
'
;
import
TranslatedSourceDescriptorCode
from
'
@gringlobal-ce/client/model/gringlobal/TranslatedSourceDescriptorCode
'
;
import
SourceDescriptorCodeLang
from
'
@gringlobal-ce/client/model/gringlobal/SourceDescriptorCodeLang
'
;
import
SourceDescriptorFilter
from
'
@gringlobal-ce/client/model/gringlobal/SourceDescriptorFilter
'
;
import
SourceDescriptorCodeFilter
from
'
@gringlobal-ce/client/model/gringlobal/SourceDescriptorCodeFilter
'
;
import
{
SourceDescriptorCodeFilteredPage
,
SourceDescriptorFilteredPage
}
from
'
@gringlobal-ce/client/model/gringlobal
'
;
import
{
IPageRequest
}
from
'
@gringlobal-ce/client/model/page
'
;
const
URL_UPDATE
=
`/api/v1/a/source-descriptor`
;
const
URL_CREATE
=
`/api/v1/a/source-descriptor`
;
const
URL_UPDATE_LANG
=
UrlTemplate
.
parse
(
`/api/v1/a/source-descriptor/{entityId}/lang/{sysLangId}`
);
const
URL_DELETE_LANG
=
UrlTemplate
.
parse
(
`/api/v1/a/source-descriptor/{entityId}/lang/{sysLangId}`
);
const
URL_UPDATE_CODE
=
`/api/v1/a/source-descriptor/code`
;
const
URL_CREATE_CODE
=
`/api/v1/a/source-descriptor/code`
;
const
URL_UPDATE_CODE_LANG
=
UrlTemplate
.
parse
(
`/api/v1/a/source-descriptor/code/{entityId}/lang/{sysLangId}`
);
const
URL_DELETE_CODE_LANG
=
UrlTemplate
.
parse
(
`/api/v1/a/source-descriptor/code/{entityId}/lang/{sysLangId}`
);
const
URL_LIST
=
`/api/v1/a/source-descriptor/list`
;
const
URL_LIST_CODE
=
`/api/v1/a/source-descriptor/code/list`
;
const
URL_GET
=
UrlTemplate
.
parse
(
`/api/v1/a/source-descriptor/{id}`
);
const
URL_REMOVE
=
UrlTemplate
.
parse
(
`/api/v1/a/source-descriptor/{id}`
);
const
URL_LIST_LANG
=
UrlTemplate
.
parse
(
`/api/v1/a/source-descriptor/{entityId}/langs`
);
const
URL_GET_CODE
=
UrlTemplate
.
parse
(
`/api/v1/a/source-descriptor/code/{id}`
);
const
URL_REMOVE_CODE
=
UrlTemplate
.
parse
(
`/api/v1/a/source-descriptor/code/{id}`
);
const
URL_LIST_CODE_LANG
=
UrlTemplate
.
parse
(
`/api/v1/a/source-descriptor/code/{entityId}/langs`
);
/**
* SourceDescriptor service
*
* GRIN-Global CE API
*/
class
SourceDescriptorService
{
private
_axios
:
AxiosInstance
;
public
constructor
(
axios
:
AxiosInstance
)
{
this
.
_axios
=
axios
;
}
/**
* update at /api/v1/a/source-descriptor
*
* @param data Request body
* @param xhrConfig additional xhr config
*/
public
update
=
(
data
:
Partial
<
SourceDescriptor
>
,
xhrConfig
?:
AxiosRequestConfig
):
Promise
<
SourceDescriptor
>
=>
{
const
apiUrl
=
URL_UPDATE
;
// console.log(`Fetching from ${apiUrl}`);
const
content
=
{
data
};
return
this
.
_axios
.
request
({
...
xhrConfig
,
url
:
apiUrl
,
method
:
'
PUT
'
,
...
content
,
}).
then
(({
data
})
=>
data
as
SourceDescriptor
);
}
/**
* create at /api/v1/a/source-descriptor
*
* @param data Request body
* @param xhrConfig additional xhr config
*/
public
create
=
(
data
:
TranslatedSourceDescriptor
,
xhrConfig
?:
AxiosRequestConfig
):
Promise
<
TranslatedSourceDescriptor
>
=>
{
const
apiUrl
=
URL_CREATE
;
// console.log(`Fetching from ${apiUrl}`);
const
content
=
{
data
};
return
this
.
_axios
.
request
({
...
xhrConfig
,
url
:
apiUrl
,
method
:
'
POST
'
,
...
content
,
}).
then
(({
data
})
=>
data
as
TranslatedSourceDescriptor
);
}
/**
* updateLang at /api/v1/a/source-descriptor/{entityId}/lang/{sysLangId}
*
* @param data Request body
* @param entityId undefined
* @param sysLangId undefined
* @param xhrConfig additional xhr config
*/
public
updateLang
=
(
data
:
SourceDescriptorLang
,
entityId
:
number
,
sysLangId
:
number
,
xhrConfig
?:
AxiosRequestConfig
):
Promise
<
SourceDescriptorLang
>
=>
{
const
apiUrl
=
URL_UPDATE_LANG
.
expand
({
entityId
,
sysLangId
});
// console.log(`Fetching from ${apiUrl}`);
const
content
=
{
data
};
return
this
.
_axios
.
request
({
...
xhrConfig
,
url
:
apiUrl
,
method
:
'
PUT
'
,
...
content
,
}).
then
(({
data
})
=>
data
as
SourceDescriptorLang
);
}
/**
* deleteLang at /api/v1/a/source-descriptor/{entityId}/lang/{sysLangId}
*
* @param entityId undefined
* @param sysLangId undefined
* @param xhrConfig additional xhr config
*/
public
deleteLang
=
(
entityId
:
number
,
sysLangId
:
number
,
xhrConfig
?:
AxiosRequestConfig
):
Promise
<
SourceDescriptorLang
>
=>
{
const
apiUrl
=
URL_DELETE_LANG
.
expand
({
entityId
,
sysLangId
});
// console.log(`Fetching from ${apiUrl}`);
const
content
=
{
/* No content in request body */
};
return
this
.
_axios
.
request
({
...
xhrConfig
,
url
:
apiUrl
,
method
:
'
DELETE
'
,
...
content
,
}).
then
(({
data
})
=>
data
as
SourceDescriptorLang
);
}
/**
* updateCode at /api/v1/a/source-descriptor/code
*
* @param data Request body
* @param xhrConfig additional xhr config
*/
public
updateCode
=
(
data
:
SourceDescriptorCode
,
xhrConfig
?:
AxiosRequestConfig
):
Promise
<
SourceDescriptorCode
>
=>
{
const
apiUrl
=
URL_UPDATE_CODE
;
// console.log(`Fetching from ${apiUrl}`);
const
content
=
{
data
};
return
this
.
_axios
.
request
({
...
xhrConfig
,
url
:
apiUrl
,
method
:
'
PUT
'
,
...
content
,
}).
then
(({
data
})
=>
data
as
SourceDescriptorCode
);
}
/**
* createCode at /api/v1/a/source-descriptor/code
*
* @param data Request body
* @param xhrConfig additional xhr config
*/
public
createCode
=
(
data
:
TranslatedSourceDescriptorCode
,
xhrConfig
?:
AxiosRequestConfig
):
Promise
<
TranslatedSourceDescriptorCode
>
=>
{
const
apiUrl
=
URL_CREATE_CODE
;
// console.log(`Fetching from ${apiUrl}`);
const
content
=
{
data
};
return
this
.
_axios
.
request
({
...
xhrConfig
,
url
:
apiUrl
,
method
:
'
POST
'
,
...
content
,
}).
then
(({
data
})
=>
data
as
TranslatedSourceDescriptorCode
);
}
/**
* updateCodeLang at /api/v1/a/source-descriptor/code/{entityId}/lang/{sysLangId}
*
* @param data Request body
* @param entityId undefined
* @param sysLangId undefined
* @param xhrConfig additional xhr config
*/
public
updateCodeLang
=
(
data
:
SourceDescriptorCodeLang
,
entityId
:
number
,
sysLangId
:
number
,
xhrConfig
?:
AxiosRequestConfig
):
Promise
<
SourceDescriptorCodeLang
>
=>
{
const
apiUrl
=
URL_UPDATE_CODE_LANG
.
expand
({
entityId
,
sysLangId
});
// console.log(`Fetching from ${apiUrl}`);
const
content
=
{
data
};
return
this
.
_axios
.
request
({
...
xhrConfig
,
url
:
apiUrl
,
method
:
'
PUT
'
,
...
content
,
}).
then
(({
data
})
=>
data
as
SourceDescriptorCodeLang
);
}
/**
* deleteCodeLang at /api/v1/a/source-descriptor/code/{entityId}/lang/{sysLangId}
*
* @param entityId undefined
* @param sysLangId undefined
* @param xhrConfig additional xhr config
*/
public
deleteCodeLang
=
(
entityId
:
number
,
sysLangId
:
number
,
xhrConfig
?:
AxiosRequestConfig
):
Promise
<
SourceDescriptorCodeLang
>
=>
{
const
apiUrl
=
URL_DELETE_CODE_LANG
.
expand
({
entityId
,
sysLangId
});
// console.log(`Fetching from ${apiUrl}`);
const
content
=
{
/* No content in request body */
};
return
this
.
_axios
.
request
({
...
xhrConfig
,
url
:
apiUrl
,
method
:
'
DELETE
'
,
...
content
,
}).
then
(({
data
})
=>
data
as
SourceDescriptorCodeLang
);
}