Skip to content

Obtener el array de TaskPreview directamente del backend #9

Description

@ArielRobotti

onMounted(async () => {
try {
const tasks = (await session.backend.getPaginateTaskPreview({
page: BigInt(0),
qtyPerPage: [BigInt(50)]
})).arr as TaskPreview[]
updatedTasks.value = tasks.map((task, i) => ({
...task,
id: task.id.toString(),
name: tasks[i]?.title,
image: logo5,
salary: tasks[i] ? printRangeRewards(tasks[i]) : "",
day: "2 days ago",
type: "Full Time",
time: "1 to 3 months",
language: tasks[i]?.keywords,
location: "Argentina"
}))
} catch (error) {
console.error('Error al llamar el método de Motoko:', error)
} finally {
loading.value = false
}
})

onMounted(async () => {
  try {
    tasks.value = (await session.backend.getPaginateTaskPreview({
      page: BigInt(0),
      qtyPerPage: [BigInt(50)]
    })).arr as TaskPreview[]
  } catch (error) {
    console.error('backend error:', error)
  } finally {
    loading.value = false
  }
})

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions