Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RTK Query - Unwrap lazy query #1508

Closed
sebastienlabine opened this issue Sep 13, 2021 · 6 comments
Closed

RTK Query - Unwrap lazy query #1508

sebastienlabine opened this issue Sep 13, 2021 · 6 comments
Labels
enhancement New feature or request rtk-query
Milestone

Comments

@sebastienlabine
Copy link

Could we give the possibility to unwrap lazy query in the same way we can unwrap mutations?

@phryneas
Copy link
Member

That requires some prerequisites that are part of #1277, but then we can finally do that, yes.

@phryneas phryneas added the enhancement New feature or request label Sep 13, 2021
@harveyappleton
Copy link

Hey @phryneas - now that #1277 is merged, would this be an easy addition? It would be great to be able to unwrap lazy queries :)

@ronnaf
Copy link

ronnaf commented Nov 23, 2021

Hey @phryneas @markerikson now that #1701 is merged, is it included in 1.7.0-beta?

@markerikson
Copy link
Collaborator

No. The last beta release was about 3 weeks ago, and this was just merged in last week. We haven't done another beta release since then. It is in the 1.7 integration branch and should be available in the CodeSandbox CI build that is automatically generated each time that integration branch is updated.

@markerikson markerikson added this to the 1.7 milestone Nov 26, 2021
@markerikson
Copy link
Collaborator

Closing as the fix is merged - will be publicly available in the next 1.7 release (beta.2 or final, whichever we end up doing)

@ZahirAbbasBKK
Copy link

ZahirAbbasBKK commented Apr 22, 2024

Hey
I am facing an issue ,after send sms Successfull message is not showing what i am doing mistake any one
function isValidPayload(payload) {
const requiredProperties = [
'partner_id',
'login_id',
'msisdn',
'message',
'end_date',
'schedule_date',
'status',
]

return requiredProperties.every((prop) => {
  return (
    payload.hasOwnProperty(prop) &&
    payload[prop] !== null &&
    payload[prop] !== undefined &&
    payload[prop] !== ''
  )
})

}
const addSms = async () => {
const payload = {
partner_id: partnerId,
login_id: loginId,
msisdn: numbers,
message: note,
end_date: endDate,
schedule_date: scheduledDate,
status: 'outgoing',
category: category,
}
const payloadSendSms = {
msisdn: numbers[0].slice(2),
text: note,
}
if (isValidPayload(payload)) {
// Object has all required properties, none are null, and none are empty

  setNote('')
  setScheduledDate(currenDate)
  setEndDate(currenDate)
  try {
    await sendSmsToMsisdn({
      body: payloadSendSms,
    }).unwrap()
    const res = await postSms({ body: payload }).unwrap()
    dispatch(
      setAlertData({
        variant: 'success',
        title: 'Success',
        message: 'Message Sent Successfully!',
      }),
    )

    if (res) {
      dispatch(
        setAlertData({
          variant: 'success',
          title: 'Success',
          message: 'Message Sent Successfully!',
        }),
      )
    }
  } catch (error) {
    setAlertData({
      variant: 'error',
      title: 'Error',
      message: 'Something Went Wrong!',
    })
  }
} else {
  dispatch(
    setAlertData({
      variant: 'error',
      title: 'Error',
      message: 'Something Went Wrong!',
    }),
  )
}

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request rtk-query
Projects
None yet
Development

No branches or pull requests

6 participants