Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F8930025
value-not-existing-in-collection.ts
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1013 B
Referenced Files
None
Subscribers
None
value-not-existing-in-collection.ts
View Options
import
ValueExistingInCollection
from
"./value-existing-in-collection"
;
import
{
Context
,
Field
}
from
"../../../main"
;
export
default
class
ValueNotExistingInCollection
extends
ValueExistingInCollection
{
getTypeName
=
()
=>
"value-not-existing-in-collection"
;
async
isProperValue
(
context
:
Context
,
new_value
:
Parameters
<
ReturnType
<
this
[
"get_field"
]
>
[
"isProperValue"
]
>
[
1
],
old_value
:
Parameters
<
ReturnType
<
this
[
"get_field"
]
>
[
"isProperValue"
]
>
[
2
]
)
{
const
field
=
this
.
get_field
();
await
field
.
isProperValue
(
context
,
new_value
,
old_value
);
if
(
this
.
include_forbidden
)
{
context
=
new
this
.
app
.
SuperContext
();
}
const
sealious_response
=
await
this
.
app
.
runAction
(
context
,
[
"collections"
,
field
.
collection
.
name
],
"show"
,
{
filter
:
{
[
field
.
name
]
:
new_value
}
}
);
if
(
!
sealious_response
.
empty
)
{
return
Field
.
invalid
(
`Collection
${
field
.
collection
.
name
}
already has a record with '
${
field
.
name
}
' set to '
${
new_value
}
'`
);
}
return
Field
.
valid
();
}
}
File Metadata
Details
Attached
Mime Type
text/x-java
Expires
Sun, Sep 21, 01:02 (1 d, 16 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
949769
Default Alt Text
value-not-existing-in-collection.ts (1013 B)
Attached To
Mode
rS Sealious
Attached
Detach File
Event Timeline
Log In to Comment