# Errata Chapter 10 (v1.0.1), deleting acronym won't actually throw an error

**URL:** <https://forums.kodeco.com/t/errata-chapter-10-v1-0-1-deleting-acronym-wont-actually-throw-an-error/45820>\
**Category:** Server Side Swift with Vapor\
**Created:** [August 11, 2018, 11:54am UTC](https://forums.kodeco.com/t/errata-chapter-10-v1-0-1-deleting-acronym-wont-actually-throw-an-error/45820 "2018-08-11T11:54:56Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![fluchtpunkt](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/fluchtpunkt/32/81494_2.png) [@fluchtpunkt](https://forums.kodeco.com/u/fluchtpunkt)\
**Post date:** [August 11, 2018, 11:54am UTC](https://forums.kodeco.com/t/errata-chapter-10-v1-0-1-deleting-acronym-wont-actually-throw-an-error/45820/1 "2018-08-11T11:54:56Z")

</div>

In Chapter 10 (page 164 in PDF) it says

> Set the URL to [http://localhost:8080/api/acronyms/1/](http://localhost:8080/api/acronyms/1/) and the method to DELETE. Send the request and **you’ll get an error back because you can’t delete the acronym while it’s linked in a sibling relationship to a category:**

Which isn’t true. There won’t be an error and the acronym will be deleted. Because we set the delete rule to `.cascade` earlier, as was pointed out correctly in the code explanation of page 162

> 5. Add a reference between the acronymID property on AcronymCategoryPivot and the id property on Acronym. This sets up the foreign key constraint. **.cascade sets a cascade schema reference action when you delete the acronym. This means that the relationship is automatically removed instead of an error being thrown.**

* * *

Additionally, on page 182 it says to open “CategoryTests.swift and uncomment all the code”. Since the chapter didn’t tell me to use the starter project I obviously don’t have those. Might make sense to either advise the user to start with the starter project, or explain how to get the two Tests.swift files into the project.

* * *

One more. In the PDF the introduction to Section IV appears on page 357 in between chapter 21 and chapter 22 instead of before chapter 23 as expected.

---

<div class="post-metadata">

**Author:** ![gekp](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/gekp/32/105896_2.png) [@gekp](https://forums.kodeco.com/u/gekp)\
**Post date:** [August 15, 2018, 9:50pm UTC](https://forums.kodeco.com/t/errata-chapter-10-v1-0-1-deleting-acronym-wont-actually-throw-an-error/45820/2 "2018-08-15T21:50:18Z")

</div>

You’re right, it doesn’t work even if you try with .restrict or .noAction instead of .cascade

---

<div class="post-metadata">

**Author:** ![andy4202](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/andy4202/32/81494_2.png) [@andy4202](https://forums.kodeco.com/u/andy4202)\
**Post date:** [August 17, 2018, 12:36am UTC](https://forums.kodeco.com/t/errata-chapter-10-v1-0-1-deleting-acronym-wont-actually-throw-an-error/45820/3 "2018-08-17T00:36:20Z")

</div>

I have this same problem where it lets me delete the acronym with ID 1.

---

<div class="post-metadata">

**Author:** ![shogunkaramazov](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/shogunkaramazov/32/108826_2.png) [@shogunkaramazov](https://forums.kodeco.com/u/shogunkaramazov)\
**Post date:** [September 1, 2018, 3:01am UTC](https://forums.kodeco.com/t/errata-chapter-10-v1-0-1-deleting-acronym-wont-actually-throw-an-error/45820/4 "2018-09-01T03:01:37Z")

</div>

@0xtim Can you please help with this when you get a chance? Thank you - much appreciated! :]

---

<div class="post-metadata">

**Author:** ![0xtim](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/0xtim/32/111111_2.png) [@0xtim](https://forums.kodeco.com/u/0xtim)\
**Post date:** [September 25, 2018, 11:49am UTC](https://forums.kodeco.com/t/errata-chapter-10-v1-0-1-deleting-acronym-wont-actually-throw-an-error/45820/5 "2018-09-25T11:49:09Z")

</div>

Hi all,

Apologies this is an error in the book. We changed the chapter at late notice to allow the iOS app to delete acronyms easily.

The reason why the delete works is because of the cascade rule for delete actions. This will allow the pivot to be deleted before deleting the acronym. If you don’t specify an `onDelete` action then the delete will fail.

This has been fixed ready for the next edition!

---

<div class="post-metadata">

**Author:** ![indrac](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/indrac/32/105896_2.png) [@indrac](https://forums.kodeco.com/u/indrac)\
**Post date:** [November 25, 2018, 11:57am UTC](https://forums.kodeco.com/t/errata-chapter-10-v1-0-1-deleting-acronym-wont-actually-throw-an-error/45820/6 "2018-11-25T11:57:17Z")

</div>

I have the same result, the acronyms get deleted. And how to fix this? I’m curious

---

<div class="post-metadata">

**Author:** ![0xtim](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/0xtim/32/111111_2.png) [@0xtim](https://forums.kodeco.com/u/0xtim)\
**Post date:** [November 26, 2018, 2:33pm UTC](https://forums.kodeco.com/t/errata-chapter-10-v1-0-1-deleting-acronym-wont-actually-throw-an-error/45820/7 "2018-11-26T14:33:50Z")

</div>

@indrac if you want it to fail then remove the `onDelete: .cascade` from the migration. That will cause the deletes to fail

---

<div class="post-metadata">

**Author:** ![errorfreeit](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/errorfreeit/32/81494_2.png) [@errorfreeit](https://forums.kodeco.com/u/errorfreeit)\
**Post date:** [January 22, 2019, 3:52am UTC](https://forums.kodeco.com/t/errata-chapter-10-v1-0-1-deleting-acronym-wont-actually-throw-an-error/45820/8 "2019-01-22T03:52:20Z")

</div>

I only came across this thread as I was composing a post regarding the same issue.

To avoid others running into issues like this it would be great to see more dynamic updates to eBook content.

---

<div class="post-metadata">

**Author:** ![shogunkaramazov](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/shogunkaramazov/32/108826_2.png) [@shogunkaramazov](https://forums.kodeco.com/u/shogunkaramazov)\
**Post date:** [February 6, 2019, 2:42am UTC](https://forums.kodeco.com/t/errata-chapter-10-v1-0-1-deleting-acronym-wont-actually-throw-an-error/45820/9 "2019-02-06T02:42:27Z")

</div>

@errorfreeit Thank you for the heads up - much appreciated! We will update the book soon. Thanks again! :]

---

<div class="post-metadata">

**Author:** ![swiftlearnerforlife](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/swiftlearnerforlife/32/110937_2.png) [@swiftlearnerforlife](https://forums.kodeco.com/u/swiftlearnerforlife)\
**Post date:** [February 7, 2019, 9:29am UTC](https://forums.kodeco.com/t/errata-chapter-10-v1-0-1-deleting-acronym-wont-actually-throw-an-error/45820/10 "2019-02-07T09:29:21Z")

</div>

Any idea when the next update is coming out? Have been waiting for this for quite a while.

---

<div class="post-metadata">

**Author:** ![shogunkaramazov](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/shogunkaramazov/32/108826_2.png) [@shogunkaramazov](https://forums.kodeco.com/u/shogunkaramazov)\
**Post date:** [February 7, 2019, 9:38am UTC](https://forums.kodeco.com/t/errata-chapter-10-v1-0-1-deleting-acronym-wont-actually-throw-an-error/45820/11 "2019-02-07T09:38:34Z")

</div>

@0xtim Can you please help with this when you get a chance? Thank you - much appreciated! :]

---

<div class="post-metadata">

**Author:** ![0xtim](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/0xtim/32/111111_2.png) [@0xtim](https://forums.kodeco.com/u/0xtim)\
**Post date:** [February 7, 2019, 12:57pm UTC](https://forums.kodeco.com/t/errata-chapter-10-v1-0-1-deleting-acronym-wont-actually-throw-an-error/45820/12 "2019-02-07T12:57:43Z")

</div>

@swiftlearnerforlife the update to the book will be released this month, so not long!

---

<div class="post-metadata">

**Author:** ![swiftlearnerforlife](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/swiftlearnerforlife/32/110937_2.png) [@swiftlearnerforlife](https://forums.kodeco.com/u/swiftlearnerforlife)\
**Post date:** [February 7, 2019, 1:02pm UTC](https://forums.kodeco.com/t/errata-chapter-10-v1-0-1-deleting-acronym-wont-actually-throw-an-error/45820/13 "2019-02-07T13:02:47Z")

</div>

Awesome Tim. Keep up the amazing work!!!
