How to use the doctypes.recurrenceConn.query function in doctypes

To help you get started, we’ve selected a few doctypes examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github cozy / cozy.github.io / en / cozy-banks / src / ducks / transactions / TransactionRecurrenceEditor.jsx View on Github external
const TransactionRecurrenceEditor = ({
  transaction,
  beforeUpdate,
  afterUpdate
}) => {
  const { t } = useI18n()
  const client = useClient()

  const current = transaction.recurrence.data
  const currentId = current && current._id
  const recurrenceCol = useQuery(recurrenceConn.query, recurrenceConn)

  const { data: allRecurrences } = recurrenceCol

  const recurrenceOptions = useMemo(
    () =>
      allRecurrences
        ? [makeNewRecurrenceOption(t)].concat(
            allRecurrences.map(makeOptionFromRecurrence)
          )
        : null,
    [allRecurrences, t]
  )

  const handleSelect = async recurrenceChoice => {
    if (beforeUpdate) {
      await beforeUpdate()
github cozy / cozy.github.io / en / cozy-banks / src / ducks / recurrence / RecurrencesPage.jsx View on Github external
const RecurrencesPage = ({ router }) => {
  const { isMobile } = useBreakpoints()
  const bundleCol = useQuery(recurrenceConn.query, recurrenceConn)
  const { data: rawBundles } = bundleCol
  const bundles = sortBundlesForViewing(rawBundles)

  const { t } = useI18n()
  const BundlesWrapper = isMobile ? BundleMobileWrapper : BundlesTable

  return (
    <>
      
      <header>
        {!isMobile ? (
          &lt;&gt;
            
              </header>
github cozy / cozy.github.io / en / cozy-banks / src / ducks / recurrence / RecurrencePage.jsx View on Github external
const RecurrenceBundlePage = ({ params }) =&gt; {
  const recurrenceCol = useQuery(recurrenceConn.query, recurrenceConn)

  const bundleId = params.bundleId
  const bundle = useDocument(RECURRENCE_DOCTYPE, bundleId)

  if (isCollectionLoading(recurrenceCol) &amp;&amp; !hasBeenLoaded(recurrenceCol)) {
    return 
  }

  return (
    &lt;&gt;
      
      {bundle ?  : null}
      {bundle ?  : null}
    
  )
}

doctypes

Shorthands for commonly used doctypes

MIT
Latest version published 8 years ago

Package Health Score

68 / 100
Full package analysis