Skip to content

Expose beforeUpsert/afterUpsert hooks#12585

Closed
arsonik wants to merge 4 commits into
sequelize:mainfrom
arsonik:patch-1
Closed

Expose beforeUpsert/afterUpsert hooks#12585
arsonik wants to merge 4 commits into
sequelize:mainfrom
arsonik:patch-1

Conversation

@arsonik
Copy link
Copy Markdown
Contributor

@arsonik arsonik commented Aug 4, 2020

Description of change

Allow Typescript users to use beforeUpsert and afterUpsert in their model hooks !

@codecov
Copy link
Copy Markdown

codecov Bot commented Aug 4, 2020

Codecov Report

Merging #12585 (fd035e2) into main (490db41) will not change coverage.
The diff coverage is n/a.

❗ Current head fd035e2 differs from pull request most recent head 6efef59. Consider uploading reports for the commit 6efef59 to get more accurate results
Impacted file tree graph

@@           Coverage Diff           @@
##             main   #12585   +/-   ##
=======================================
  Coverage   96.44%   96.44%           
=======================================
  Files          95       95           
  Lines        9162     9162           
=======================================
  Hits         8836     8836           
  Misses        326      326           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 490db41...6efef59. Read the comment docs.

@arsonik arsonik changed the title Expose beforeUpsert & afterUpsert in hooks.d.ts Expose beforeUpsert/afterUpsert hooks, plain model query Aug 11, 2020
@brenwell
Copy link
Copy Markdown

I will be looking forward to this, thanks

@arsonik
Copy link
Copy Markdown
Contributor Author

arsonik commented Apr 28, 2021

UP ?

@Keimeno Keimeno changed the base branch from v6 to main August 9, 2021 08:06
@github-actions github-actions Bot added the stale label Oct 31, 2021
@arsonik
Copy link
Copy Markdown
Contributor Author

arsonik commented Nov 2, 2021

fixed I believe

@arsonik arsonik closed this Nov 2, 2021
@arsonik
Copy link
Copy Markdown
Contributor Author

arsonik commented Nov 2, 2021

nope was fixed for before/after upsert
still missing the null return

        query<M extends Model>(sql: string | { query: string; values: unknown[] }, options: QueryOptionsWithModel<M> & { plain: true }): Promise<M | null>;```

@arsonik arsonik reopened this Nov 2, 2021
@github-actions github-actions Bot removed the stale label Nov 3, 2021
@github-actions github-actions Bot added the stale label Nov 18, 2021
@ephys ephys changed the title Expose beforeUpsert/afterUpsert hooks, plain model query Expose beforeUpsert/afterUpsert hooks Jan 6, 2022
@ephys
Copy link
Copy Markdown
Member

ephys commented Jan 6, 2022

Sorry for taking so long to review this.

I'm going around old TS PRs to merge them.

The plain query typing was fixed in your other PR #13899
@arsonik can you resolve the conflict?

Can you also add a test in types/test to prevent regressions?
Simply call those methods with the right signature.

@ephys ephys self-requested a review January 6, 2022 14:43
@ephys ephys added typescript For issues and PRs. Things that involve typescript, such as typings and intellisense. status: awaiting response For issues and PRs. OP must respond (or change something, if it is a PR). Maintainers have no action and removed stale labels Jan 6, 2022
@github-actions github-actions Bot removed the status: awaiting response For issues and PRs. OP must respond (or change something, if it is a PR). Maintainers have no action label Jan 6, 2022
@arsonik arsonik closed this Jan 6, 2022
@arsonik arsonik deleted the patch-1 branch January 6, 2022 14:51
@papb
Copy link
Copy Markdown
Member

papb commented Jan 18, 2022

Hi @arsonik, why did you close the PR?

@arsonik
Copy link
Copy Markdown
Contributor Author

arsonik commented Jan 18, 2022

Hi @arsonik, why did you close the PR?

Because a more recent PR that fixes the issue was merged

#13899

@ephys
Copy link
Copy Markdown
Member

ephys commented Jan 18, 2022

Oh I didn't notice you closed this PR. It's still interesting for the afterUpsert/beforeUpsert part :)

@arsonik
Copy link
Copy Markdown
Contributor Author

arsonik commented Jan 18, 2022

because that PR was merged
#13394

@ephys
Copy link
Copy Markdown
Member

ephys commented Jan 18, 2022

Aaah! Thanks :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

typescript For issues and PRs. Things that involve typescript, such as typings and intellisense.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants