Skip to content

Commit 621008d

Browse files
authored
fix: update InputField query to handle globals (#12)
1 parent bcdb085 commit 621008d

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/fields/PublishDate/components/InputField.tsx

+10-1
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,19 @@ const InputField: (datePickerProps: ConditionalDateProps) => React.FC<Props> =
3737
// verify that scheduled posts actually have a job
3838
const doc = useDocumentInfo()
3939
const [queued, setQueued] = useState<boolean>()
40+
4041
useEffect(() => {
4142
async function verifySchedule() {
43+
const isGlobal = doc?.global !== undefined
44+
4245
try {
43-
const qs = {
46+
const qs = isGlobal ? {
47+
where: {
48+
global: {
49+
equals: doc.global?.slug
50+
}
51+
}
52+
} : {
4453
where: {
4554
and: [
4655
{

0 commit comments

Comments
 (0)