-
Notifications
You must be signed in to change notification settings - Fork 17
Potential typing issue with datastore API #81
Copy link
Copy link
Open
Labels
questionFurther information is requestedFurther information is requested
Description
Need to reproduce as a first step!
But, as reported in a feedback session by a community developer, with the following datastore:
export const OldestCodeReviewDatastore = DefineDatastore({
name: 'code_review_datastore',
attributes: {
id: {
type: Schema.types.string
},
timestamp: {
type: Schema.types.string
}
},
primary_key: 'id'
})
This code apparently returns an any type.
async function getOldestReview(client: SlackAPIClient, channel: string) {
const oldestReview = await client.apps.datastore.get<typeof OldestCodeReviewDatastore.definition>({
datastore: 'code_review_datastore',
id: 'oldest_review_' + channel
})
if (!oldestReview.ok) {
console.log('Error during request apps.datastore.get!', oldestReview)
return '0'
}
return oldestReview?.item?.timestamp ?? '0'
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
questionFurther information is requestedFurther information is requested